Class: SimpleAuthentication::PasswordAuthenticator

Inherits:
Authenticator
  • Object
show all
Defined in:
lib/simple_password_authentication/password_authenticator.rb

Instance Method Summary collapse

Instance Method Details

#authenticateObject



12
13
14
# File 'lib/simple_password_authentication/password_authenticator.rb', line 12

def authenticate
  User.authenticate(params[:username], params[:password])
end

#authentication_possible?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/simple_password_authentication/password_authenticator.rb', line 7

def authentication_possible?
  !params.values_at(:username, :password).any?{|v| v.blank? }
end