Hashing password

Using postgres' pgcrypt
This commit is contained in:
cdricms
2025-01-17 10:39:59 +01:00
parent 89f44f4469
commit fdc3122b68
7 changed files with 88 additions and 28 deletions

View File

@@ -32,14 +32,15 @@ func HandleCreateUser(w http.ResponseWriter, r *http.Request) {
log.Println(user)
res, err := core.DB.NewInsert().Model(&user).Exec(context.Background())
if res == nil {
core.JSONError{
Status: core.Error,
Message: "The user couldn't be inserted.",
}.Respond(w, http.StatusNotAcceptable)
return
}
res, err := user.Insert(context.Background())
log.Println(res)
// if res == nil {
// core.JSONError{
// Status: core.Error,
// Message: "The user couldn't be inserted.",
// }.Respond(w, http.StatusNotAcceptable)
// return
// }
if err != nil {
core.JSONError{