FIX: setting new password should reset password_expired_at (#29296)

This commit is contained in:
Kelv
2024-10-21 07:24:43 +08:00
committed by GitHub
parent 201c174b43
commit 698748bfec
2 changed files with 43 additions and 0 deletions

View File

@ -59,6 +59,7 @@ class UserPassword < ActiveRecord::Base
self.password_salt = SecureRandom.hex(PASSWORD_SALT_LENGTH)
self.password_algorithm = TARGET_PASSWORD_ALGORITHM
self.password_hash = hash_password(@raw_password, password_salt, password_algorithm)
self.password_expired_at = nil
end
def regen_password!(pw)