module Sinatra::Authentication::Identification
Public Instance Methods
authenticate(login, password)
click to toggle source
# File lib/sinatra/authentication/identification.rb, line 4 def authenticate(login, password) if user = find_by_login(login) if Password::Hashing.check?(password, user.password) user end end end
find_by_login(login)
click to toggle source
NOTE: This is overridden in Ottoman.User
# File lib/sinatra/authentication/identification.rb, line 13 def find_by_login(login) find(__LOGIN_FIELD__ => login).first end
Protected Instance Methods
__LOGIN_FIELD__()
click to toggle source
# File lib/sinatra/authentication/identification.rb, line 18 def __LOGIN_FIELD__ LoginField.attr_name end