Class: OmniauthCallbacksController

Inherits:
Devise::OmniauthCallbacksController
  • Object
show all
Defined in:
lib/generators/templates/controllers/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#allObject Also known as: facebook, twitter, linkedin, github, passthru, google_oauth2



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/generators/templates/controllers/omniauth_callbacks_controller.rb', line 3

def all
  p env["omniauth.auth"]
  user = User.from_omniauth(env["omniauth.auth"], current_user)
  if user.persisted?
    flash[:notice] = "You are in..!!! Go to edit profile to see the status for the accounts"
    (user)
  else
    session["devise.user_attributes"] = user.attributes
    redirect_to new_user_registration_url
  end
end

#failureObject



15
16
17
18
19
# File 'lib/generators/templates/controllers/omniauth_callbacks_controller.rb', line 15

def failure
  #handle you logic here..
  #and delegate to super.
  super
end