Class: Users::OmniauthCallbacksController

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

Instance Method Summary collapse

Instance Method Details

#failureObject



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

#mlhObject



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?
     @user, event: :authentication # this will throw if @user is not activated
    session["devise.provider_data"] = request.env["omniauth.auth"]
    set_flash_message(:notice, :success, kind: "My MLH") if is_navigational_format?
  else
    redirect_to new_user_registration_url
  end
end