diff options
author | jomo <github@jomo.tv> | 2015-12-17 00:58:27 +0100 |
---|---|---|
committer | jomo <github@jomo.tv> | 2015-12-17 00:58:27 +0100 |
commit | 756d0d10473ddf6528b0848a5d7a92524bb66317 (patch) | |
tree | b9eb091036914712f33879d4d33fe81225103186 | |
parent | bf91ef766c49fdd185a5d7e4477789085c3c0578 (diff) |
bcrypt has a 72 character limit :'(
56 bytes limit of eksblowfish, to be exact
-rw-r--r-- | app/models/user.rb | 2 | ||||
-rw-r--r-- | db/seeds.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 16b5ecf..7224f4b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,7 +13,7 @@ class User < ActiveRecord::Base validates_presence_of :password, :password_confirmation, :email_token, on: :create validates_presence_of :name, :email, :ign - validates_length_of :password, in: 8..256, on: [:create, :update], allow_nil: true + validates_length_of :password, in: 8..72, on: [:create, :update], allow_nil: true validates_length_of :name, in: 2..30 validates_length_of :about, maximum: 5000 validates_length_of :ign, minimum: 1, maximum: 16 diff --git a/db/seeds.rb b/db/seeds.rb index 4d19adb..780ddb5 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -10,7 +10,7 @@ Role.create!([ {name: "superadmin", value: 500, color: "#d22"} ]) -userpw = SecureRandom.hex(64) +userpw = SecureRandom.hex(36) # fallback profile for deleted users |