Hashing password
Using postgres' pgcrypt
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user