[bugfix] fix old password hash staying in cache (#1432)

This commit is contained in:
tobi 2023-02-06 09:44:13 +01:00 committed by GitHub
parent 83b522a1b6
commit 75e1b9c896
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,6 @@ package user
import (
"context"
"time"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"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.UpdatedAt = time.Now()
if err := p.db.UpdateByID(ctx, user, user.ID, "encrypted_password", "updated_at"); err != nil {
return gtserror.NewErrorInternalError(err, "database error")
if err := p.db.UpdateUser(ctx, user, "encrypted_password"); err != nil {
return gtserror.NewErrorInternalError(err)
}
return nil