Sha256: fb55e18c3d743c9c1c0fd338a1c3dd0a3f7e501eb829281a886b4ccfd05c37fe

Contents?: true

Size: 626 Bytes

Versions: 44

Compression:

Stored size: 626 Bytes

Contents

class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
  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"]
      set_flash_message(:notice, :success, kind: "My MLH") if is_navigational_format?
    else
      redirect_to new_user_registration_url
    end
  end

  def failure
    flash[:notice] = "External authentication failed - try again?"
    redirect_to new_user_session_url
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
hackathon_manager-0.14.1 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.14.0 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.12 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.11 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.10 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.9 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.8 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.7 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.6 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.5 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.4 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.3 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.2 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.1 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.13.0 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.12.2 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.12.1 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.12.0 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.11.2 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.11.1 app/controllers/users/omniauth_callbacks_controller.rb