mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Refactor SecurePassword#authenticate
This commit is contained in:
parent
71bd5096be
commit
ffa974d55c
1 changed files with 1 additions and 5 deletions
|
@ -55,11 +55,7 @@ module ActiveModel
|
|||
module InstanceMethodsOnActivation
|
||||
# Returns self if the password is correct, otherwise false.
|
||||
def authenticate(unencrypted_password)
|
||||
if BCrypt::Password.new(password_digest) == unencrypted_password
|
||||
self
|
||||
else
|
||||
false
|
||||
end
|
||||
BCrypt::Password.new(password_digest) == unencrypted_password && self
|
||||
end
|
||||
|
||||
# Encrypts the password into the password_digest attribute.
|
||||
|
|
Loading…
Reference in a new issue