Class: AuthenticationController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- AuthenticationController
- Includes:
- Authentication
- Defined in:
- app/controllers/authentication_controller.rb
Overview
Authentication with form and OAuth
Instance Method Summary collapse
-
#create ⇒ Object
post /login.
-
#destroy ⇒ Object
delete /logout.
-
#new ⇒ Object
get /login.
Methods included from Authentication
#cookie_data, #create_token_for_user, #deactivate_token, #pop_token, #redirect_authenticated_user
Instance Method Details
#create ⇒ Object
post /login
14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/authentication_controller.rb', line 14 def create user = User[param_from_request(:login).downcase] handler = Biovision::Components::UsersComponent[user] if handler.authenticate(params[:password], tracking_for_entity) auth_success(handler.user) else auth_failed end end |
#destroy ⇒ Object
delete /logout
26 27 28 29 30 |
# File 'app/controllers/authentication_controller.rb', line 26 def destroy deactivate_token if current_user redirect_to root_path end |
#new ⇒ Object
get /login
10 11 |
# File 'app/controllers/authentication_controller.rb', line 10 def new end |