Class: Challah::Authenticators::Password

Inherits:
Object
  • Object
show all
Defined in:
lib/challah/authenticators/password.rb

Class Method Summary collapse

Class Method Details

.match?(user, provider, plain_password) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
# File 'lib/challah/authenticators/password.rb', line 4

def self.match?(user, provider, plain_password)
  if !!provider
    crypted_password = provider.fetch(:token)
    return Encrypter.compare(crypted_password, plain_password)
  end

  false
end