Class: Stall::OmniauthCallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Includes:
OmniauthHelper
Defined in:
app/controllers/stall/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Methods included from OmniauthHelper

#user_omniauth_authorize_path_for

Instance Method Details

#facebookObject



13
14
15
# File 'app/controllers/stall/omniauth_callbacks_controller.rb', line 13

def facebook
  authenticate_user_from_oauth_callback!
end

#google_oauth2Object



17
18
19
# File 'app/controllers/stall/omniauth_callbacks_controller.rb', line 17

def google_oauth2
  authenticate_user_from_oauth_callback!
end

#redirectObject

Pre-authorize request to store the redirect path, allowing users to get back to the checkout wether the authentication is successful or not.



8
9
10
11
# File 'app/controllers/stall/omniauth_callbacks_controller.rb', line 8

def redirect
  session['omniauth.after_sign_in_redirect_path'] = params[:_redirect_to] if params[:_redirect_to]
  redirect_to user_omniauth_authorize_path_for(params[:provider])
end