mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use more semantic method to check password
This commit is contained in:
parent
0c070ae568
commit
a928928c96
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ module ActiveModel
|
||||||
# user.authenticate('notright') # => false
|
# user.authenticate('notright') # => false
|
||||||
# user.authenticate('mUc3m00RsqyRe') # => user
|
# user.authenticate('mUc3m00RsqyRe') # => user
|
||||||
def authenticate(unencrypted_password)
|
def authenticate(unencrypted_password)
|
||||||
BCrypt::Password.new(password_digest) == unencrypted_password && self
|
BCrypt::Password.new(password_digest).is_password?(unencrypted_password) && self
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :password
|
attr_reader :password
|
||||||
|
|
Loading…
Reference in a new issue