1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
# frozen-string-literal: true
module Rodauth
Feature.define(:update_password_hash, :UpdatePasswordHash) do
depends :login_password_requirements_base
def password_match?(password)
if (result = super) && update_password_hash?
@update_password_hash = false
set_password(password)
end
result
end
private
def update_password_hash?
password_hash_cost != @current_password_hash_cost || @update_password_hash
end
def get_password_hash
if hash = super
@current_password_hash_cost = extract_password_hash_cost(hash)
end
hash
end
end
end
|