diff options
Diffstat (limited to 'user/db_actions.go')
-rw-r--r-- | user/db_actions.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/user/db_actions.go b/user/db_actions.go index 611507d..2d89b7e 100644 --- a/user/db_actions.go +++ b/user/db_actions.go @@ -26,7 +26,10 @@ import ( // Add user to db func saveUser(u User) (primitive.ObjectID, error) { - u.hashPassword() + err := u.hashPassword() + if err != nil { + return *new(primitive.ObjectID), err + } res, err := db.InsertOne(context.TODO(), u) return res.InsertedID.(primitive.ObjectID), err } |