Class: OmniauthCallbacksController
- Inherits:
-
Devise::OmniauthCallbacksController
- Object
- Devise::OmniauthCallbacksController
- OmniauthCallbacksController
- Defined in:
- lib/generators/templates/controllers/omniauth_callbacks_controller.rb
Instance Method Summary collapse
- #all ⇒ Object (also: #facebook, #twitter, #linkedin, #github, #passthru, #google_oauth2)
- #failure ⇒ Object
Instance Method Details
#all ⇒ Object 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" sign_in_and_redirect(user) else session["devise.user_attributes"] = user.attributes redirect_to new_user_registration_url end end |
#failure ⇒ Object
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 |