Commit 3d743d45670ae5ec978dffa9c143e2ce43587646

Authored by Dmitriy Zaporozhets
2 parents 5437c3ea 87d16e18

Merge branch 'custom_password_length' into 'master'

Document how to customize password length limits
config/initializers/devise_password_length.rb.example 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +Devise.setup do |config|
  2 + # The following line changes the password length limits for new users. In the
  3 + # example below the minimum length is 12 characters, and the maximum length
  4 + # is 128 characters.
  5 + config.password_length = 12..128
  6 +end
... ...
doc/security/password_length_limits.md 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +# Custom password length limits
  2 +
  3 +If you want to enforce longer user passwords you can create an extra Devise initializer with the steps below.
  4 +If you do not use the `devise_password_length.rb` initializer the password length is set to a minimum of 8 characters in `config/initializers/devise.rb`.
  5 +
  6 +```bash
  7 +cd /home/git/gitlab
  8 +sudo -u git -H cp config/initializers/devise_password_length.rb.example config/initializers/devise_password_length.rb
  9 +sudo -u git -H editor config/initializers/devise_password_length.rb # inspect and edit the new password length limits
  10 +```
... ...