Class: AuthController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AuthController
- Defined in:
- app/controllers/auth_controller.rb
Constant Summary
Constants included from PaginationHelper
PaginationHelper::DEFAULT_OPTIONS, PaginationHelper::OPTIONS
Instance Method Summary collapse
- #index ⇒ Object
- #login ⇒ Object
-
#logout ⇒ Object
logout() removes the session information set in login() and then deletes the session.
Methods included from PaginationHelper
included, #paginate, validate_options!
Instance Method Details
#index ⇒ Object
2 3 4 5 |
# File 'app/controllers/auth_controller.rb', line 2 def index login render_action 'login' end |
#login ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/auth_controller.rb', line 7 def login if @request.post? if user = User.authenticate(@params['username'], @params['password']) start_user_session(user) redirect_to_main return end end end |
#logout ⇒ Object
logout() removes the session information set in login() and then deletes the session. The browser is then redirected to the log in form.
19 20 21 22 |
# File 'app/controllers/auth_controller.rb', line 19 def logout end_user_session redirect_to_main end |