mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Minimum password length is configurable with the min_password_length site setting. FIX: reset password needs to validate password length.
This commit is contained in:
@ -4,8 +4,8 @@ class PasswordValidator < ActiveModel::EachValidator
|
||||
return unless record.password_required?
|
||||
if value.nil?
|
||||
record.errors.add(attribute, :blank)
|
||||
elsif value.length < 6
|
||||
record.errors.add(attribute, :too_short, count: 6)
|
||||
elsif value.length < SiteSetting.min_password_length
|
||||
record.errors.add(attribute, :too_short, count: SiteSetting.min_password_length)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user