Module: Sinatra::Chowder
- Defined in:
- lib/sinatra/chowder.rb
Instance Method Summary collapse
- #authorized? ⇒ Boolean
- #current_user ⇒ Object
- #login ⇒ Object
- #logout ⇒ Object
- #require_user ⇒ Object
Instance Method Details
#authorized? ⇒ Boolean
9 10 11 |
# File 'lib/sinatra/chowder.rb', line 9 def session[:current_user] end |
#current_user ⇒ Object
5 6 7 |
# File 'lib/sinatra/chowder.rb', line 5 def current_user session[:current_user] end |
#login ⇒ Object
13 14 15 16 |
# File 'lib/sinatra/chowder.rb', line 13 def login session[:redirect_to] = request.path_info redirect request.script_name + '/login' end |
#logout ⇒ Object
18 19 20 |
# File 'lib/sinatra/chowder.rb', line 18 def logout session[:current_user] = nil end |
#require_user ⇒ Object
22 23 24 |
# File 'lib/sinatra/chowder.rb', line 22 def require_user login unless end |