mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 03:18:23 +00:00
fixed password validator on equality with email
This commit is contained in:
parent
93855db158
commit
53fb84baa3
@ -10,7 +10,7 @@ class PasswordValidator < ActiveModel::EachValidator
|
||||
record.errors.add(attribute, :too_short, count: SiteSetting.min_password_length)
|
||||
elsif record.username.present? && value == record.username
|
||||
record.errors.add(attribute, :same_as_username)
|
||||
elsif record.username.present? && value == record.email
|
||||
elsif record.email.present? && value == record.email
|
||||
record.errors.add(attribute, :same_as_email)
|
||||
elsif SiteSetting.block_common_passwords && CommonPasswords.common_password?(value)
|
||||
record.errors.add(attribute, :common)
|
||||
|
Loading…
x
Reference in New Issue
Block a user