Class: Empower::OmniauthCallbacksController
- Inherits:
-
EmpowerController
- Object
- ApplicationController
- EmpowerController
- Empower::OmniauthCallbacksController
- Defined in:
- app/controllers/empower/omniauth_callbacks_controller.rb
Instance Method Summary collapse
Instance Method Details
#facebook ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/empower/omniauth_callbacks_controller.rb', line 5 def facebook @user = User.from_omniauth(request.env["omniauth.auth"]) if @user.persisted? sign_in @user #this will throw if @user is not activated redirect_to after_sign_in_path_for(@user) else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to after_sign_in_path_for(@user) end end |
#failure ⇒ Object
17 18 19 20 21 22 |
# File 'app/controllers/empower/omniauth_callbacks_controller.rb', line 17 def failure redirect_to( (session[:redirect] || main_app.root_path), :alert => "Could not authenticate your request." ) end |