diff options
author | Rohit Arondekar <rohit.arondekar@gmail.com> | 2014-12-30 21:27:46 +0530 |
---|---|---|
committer | Rohit Arondekar <rohit.arondekar@gmail.com> | 2014-12-30 21:27:46 +0530 |
commit | a928928c9668f02735707b4e6edf2632fe191814 (patch) | |
tree | c43dcb6ca39266387c6519fcc4c1de91e755ad97 | |
parent | 0c070ae568767a2c8e9bdec49ab3a1a24f113382 (diff) | |
download | rails-a928928c9668f02735707b4e6edf2632fe191814.tar.gz rails-a928928c9668f02735707b4e6edf2632fe191814.tar.bz2 rails-a928928c9668f02735707b4e6edf2632fe191814.zip |
Use more semantic method to check password
-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 |