instance method
authenticate
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v5.2.8.1Signature
authenticate(unencrypted_password)
Returns self if the password is correct, otherwise false.
Parameters
-
unencrypted_passwordreq
Source
# File activemodel/lib/active_model/secure_password.rb, line 57
def authenticate(unencrypted_password)
if BCrypt::Password.new(password_digest) == unencrypted_password
self
else
false
end
end
Defined in activemodel/lib/active_model/secure_password.rb line 57
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::SecurePassword::InstanceMethodsOnActivation