Class: HomeController

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

Instance Method Summary collapse

Instance Method Details

#indexObject


17
18
# File 'app/controllers/home_controller.rb', line 17

def index
end

#logoutObject


20
21
22
23
24
25
# File 'app/controllers/home_controller.rb', line 20

def logout
  reset_session
  @current_user = nil
  @mygov_access_token = nil
  redirect_to root_url
end

#oauth_callbackObject


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

def oauth_callback
  auth = request.env["omniauth.auth"]
  return_to = session[:return_to]

  reset_session
  session[:user] = auth.extra.raw_info.to_hash
  handle_new_users_from_oauth
  session[:token] = auth.credentials.token
  flash[:success] = "You successfully signed in"
  redirect_to return_to || carts_path
end