mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-01 06:50:00 +00:00
[bugfix] fix old password hash staying in cache (#1432)
This commit is contained in:
parent
83b522a1b6
commit
75e1b9c896
1 changed files with 2 additions and 4 deletions
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||||
|
@ -43,10 +42,9 @@ func (p *processor) ChangePassword(ctx context.Context, user *gtsmodel.User, old
|
||||||
}
|
}
|
||||||
|
|
||||||
user.EncryptedPassword = string(newPasswordHash)
|
user.EncryptedPassword = string(newPasswordHash)
|
||||||
user.UpdatedAt = time.Now()
|
|
||||||
|
|
||||||
if err := p.db.UpdateByID(ctx, user, user.ID, "encrypted_password", "updated_at"); err != nil {
|
if err := p.db.UpdateUser(ctx, user, "encrypted_password"); err != nil {
|
||||||
return gtserror.NewErrorInternalError(err, "database error")
|
return gtserror.NewErrorInternalError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue