fix(user): clear need_change_password and invalidate cache on password change

This commit is contained in:
ryan
2026-08-29 11:52:41 +08:00
parent d3d7c783a9
commit 64fe1658d4
5 changed files with 77 additions and 8 deletions
+6 -2
View File
@@ -174,10 +174,14 @@ func (s *userServiceImpl) UpdatePassword(ctx context.Context, id uint64, oldPass
return err
}
return updateUserColumns(ctx, id, map[string]any{
if err := updateUserColumns(ctx, id, map[string]any{
"password": user.Password,
columnUpdatedAt: time.Now(),
})
}); err != nil {
return err
}
invalidateUserCache(ctx, id)
return nil
}
func (s *userServiceImpl) VerifyPassword(ctx context.Context, id uint64, password string) bool {