mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 17:51:13 +08:00
Add configuration parameter defining password min length through env variable PASSWORD_MIN_LENGTH (#7657)
This commit is contained in:
parent
3cb610280d
commit
89ded1f0f9
1 changed files with 4 additions and 1 deletions
|
@ -192,7 +192,10 @@ Devise.setup do |config|
|
|||
|
||||
# ==> Configuration for :validatable
|
||||
# Range for password length.
|
||||
config.password_length = 8..72
|
||||
password_min_length = ENV['PASSWORD_MIN_LENGTH'].to_i
|
||||
password_max_length = 72
|
||||
password_min_length = 8 unless password_min_length.positive? && password_min_length < password_max_length
|
||||
config.password_length = password_min_length..password_max_length
|
||||
|
||||
# Email regex used to validate email formats. It simply asserts that
|
||||
# one (and only one) @ exists in the given string. This is mainly
|
||||
|
|
Loading…
Reference in a new issue