From 75e1b9c896ed78bb97ea7d0eb3ef8a888c86ce50 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 6 Feb 2023 09:44:13 +0100 Subject: [PATCH] [bugfix] fix old password hash staying in cache (#1432) --- internal/processing/user/changepassword.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/processing/user/changepassword.go b/internal/processing/user/changepassword.go index 23e5c787..03b8c452 100644 --- a/internal/processing/user/changepassword.go +++ b/internal/processing/user/changepassword.go @@ -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