Class: Shipit::GithubAuthenticationController

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

Instance Method Summary collapse

Instance Method Details

#callbackObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/shipit/github_authentication_controller.rb', line 6

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



17
18
19
20
# File 'app/controllers/shipit/github_authentication_controller.rb', line 17

def logout
  reset_session
  redirect_to(root_path)
end