Rifiuta il riuso della password attuale in cambio e reset.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-08 11:31:47 +02:00
co-authored by Cursor
parent 53449c5d3c
commit dd9901519a
17 changed files with 60 additions and 0 deletions
@@ -31,6 +31,13 @@ module PasswordComplexity
matched >= REQUIRED_CLASSES
end
# Confronta con il digest già salvato (prima di assegnare la nuova password).
def same_as_current?(record, password)
return false if password.blank? || !record.respond_to?(:authenticate)
record.authenticate(password).present?
end
def requirement_summary
I18n.t("password_policy.hint")
end