Class: Users::OmniauthCallbacksController
- Inherits:
-
Devise::OmniauthCallbacksController
- Object
- Devise::OmniauthCallbacksController
- Users::OmniauthCallbacksController
- Defined in:
- app/controllers/users/omniauth_callbacks_controller.rb
Instance Method Summary collapse
Instance Method Details
#failure ⇒ Object
13 14 15 16 |
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 13 def failure flash[:notice] = "External authentication failed - try again?" redirect_to new_user_session_url end |
#mlh ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'app/controllers/users/omniauth_callbacks_controller.rb', line 2 def mlh @user = User.from_omniauth(request.env["omniauth.auth"]) if @user.persisted? sign_in_and_redirect @user, event: :authentication # this will throw if @user is not activated session["devise.provider_data"] = request.env["omniauth.auth"] (:notice, :success, kind: "My MLH") if else redirect_to new_user_registration_url end end |