Class: AuthenticationController

Inherits:
ApplicationController
  • Object
show all
Includes:
Authentication
Defined in:
app/controllers/authentication_controller.rb

Overview

Authentication with form and OAuth

Instance Method Summary collapse

Methods included from Authentication

#cookie_data, #create_token_for_user, #deactivate_token, #pop_token, #redirect_authenticated_user

Instance Method Details

#createObject

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

#destroyObject

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

#newObject

get /login



10
11
# File 'app/controllers/authentication_controller.rb', line 10

def new
end