Module: Sinatra::Fx::Auth::Helpers
- Defined in:
- lib/sinatra/fx-auth.rb
Instance Method Summary collapse
Instance Method Details
#authenticated? ⇒ Boolean
11 12 13 14 15 16 17 |
# File 'lib/sinatra/fx-auth.rb', line 11 def authenticated? authenticated = false profile, token = token_credentials authenticated = profile.authenticate? token if profile #, request.ip if profile log_authentication_failure profile, token unless authenticated #, request.ip unless authenticated authenticated end |
#authorized?(*roles) ⇒ Boolean
20 21 22 23 24 25 26 |
# File 'lib/sinatra/fx-auth.rb', line 20 def *roles = false profile, token = token_credentials = profile. roles if profile profile, roles unless end |