Module: Sinatra::Authentication::Identification
- Defined in:
- lib/sinatra/authentication/identification.rb
Instance Method Summary collapse
- #authenticate(login, password) ⇒ Object
-
#find_by_login(login) ⇒ Object
NOTE: This is overridden in Ottoman.User.
Instance Method Details
#authenticate(login, password) ⇒ Object
4 5 6 7 8 9 10 |
# 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) ⇒ Object
NOTE: This is overridden in Ottoman.User
13 14 15 |
# File 'lib/sinatra/authentication/identification.rb', line 13 def find_by_login(login) find(__LOGIN_FIELD__ => login).first end |