Class: GithubAuthenticationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/github_authentication_controller.rb

Instance Method Summary collapse

Instance Method Details

#callbackObject



4
5
6
7
8
9
10
11
12
# File 'app/controllers/github_authentication_controller.rb', line 4

def callback
  return_url = request.env['omniauth.origin'] || root_path
  auth = request.env['omniauth.auth']

  return render 'failed', layout: false if auth.blank?

  session[:user_id] = (auth)
  redirect_to return_url
end

#logoutObject



14
15
16
17
# File 'app/controllers/github_authentication_controller.rb', line 14

def logout
  reset_session
  redirect_to root_path
end