Class: Auth1::SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/auth1/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#callbackObject



7
8
9
10
11
12
13
14
# File 'app/controllers/auth1/sessions_controller.rb', line 7

def callback
  # This stores all the user information that came from Auth0 and the IdP
  # See also: https://github.com/auth0/omniauth-auth0#authentication-hash
  session[:userinfo] = request.env['omniauth.auth']

  # Redirect to the URL you want after successful auth
  redirect_to request.env['omniauth.origin']
end

#failureObject



16
17
18
19
# File 'app/controllers/auth1/sessions_controller.rb', line 16

def failure
  # show a failure page or redirect to an error page
  @error_msg = request.params['message']
end

#logoutObject



21
22
23
24
# File 'app/controllers/auth1/sessions_controller.rb', line 21

def logout
  reset_session
  redirect_to auth0_logout_url
end