diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-30 14:15:59 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-12-30 14:15:59 -0300 |
commit | 426da75b74be94946690fd659a4a1a1119708efc (patch) | |
tree | 03a887083bd2548f7465380faef9af99a04507fb | |
parent | 164370dac64d0279060afde94c235ff66cd5b9a5 (diff) | |
parent | a928928c9668f02735707b4e6edf2632fe191814 (diff) | |
download | rails-426da75b74be94946690fd659a4a1a1119708efc.tar.gz rails-426da75b74be94946690fd659a4a1a1119708efc.tar.bz2 rails-426da75b74be94946690fd659a4a1a1119708efc.zip |
Merge pull request #18256 from rohit/secure-password-tweak
Use more semantic method to authenticate password in SecurePassword
-rw-r--r-- | activemodel/lib/active_model/secure_password.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb index 8f2a069ba3..96e88f1b6c 100644 --- a/activemodel/lib/active_model/secure_password.rb +++ b/activemodel/lib/active_model/secure_password.rb @@ -99,7 +99,7 @@ module ActiveModel # user.authenticate('notright') # => false # user.authenticate('mUc3m00RsqyRe') # => user def authenticate(unencrypted_password) - BCrypt::Password.new(password_digest) == unencrypted_password && self + BCrypt::Password.new(password_digest).is_password?(unencrypted_password) && self end attr_reader :password |