aboutsummaryrefslogtreecommitdiff
path: root/internal/db/users.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/users.go')
-rw-r--r--internal/db/users.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/users.go b/internal/db/users.go
index d537b8d3..fa327157 100644
--- a/internal/db/users.go
+++ b/internal/db/users.go
@@ -117,7 +117,7 @@ func (db *users) Authenticate(ctx context.Context, login, password string, login
// Validate password hash fetched from database for local accounts.
if user.IsLocal() {
- if user.ValidatePassword(password) {
+ if userutil.ValidatePassword(user.Password, user.Salt, password) {
return user, nil
}
@@ -262,7 +262,7 @@ func (db *users) Create(ctx context.Context, username, email string, opts Create
if err != nil {
return nil, err
}
- user.EncodePassword()
+ user.Password = userutil.EncodePassword(user.Password, user.Salt)
return user, db.WithContext(ctx).Create(user).Error
}