instance method authenticate

Ruby on Rails 3.1.12

Since v3.1.12 Last seen in v5.2.8.1

Available in: v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1

Signature

authenticate(unencrypted_password)

Returns self if the password is correct, otherwise false.

Parameters

unencrypted_password req
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close