Sha256: 7e557b00511a9196b20e46149ba1c8f621bf3c4dd9df53a23ee0798e12b4730f

Contents?: true

Size: 659 Bytes

Versions: 19

Compression:

Stored size: 659 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?
      @user.queue_reminder_email
    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

19 entries across 19 versions & 1 rubygems

Version Path
hackathon_manager-0.5.7 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.5.6 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.5.5 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.5.4 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.5.3 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.5.2 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.5.1 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.5.0 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.4.4 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.4.3 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.4.2 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.4.1 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.4.0 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.3.3 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.3.2 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.3.1 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.3.0 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.2.0 app/controllers/users/omniauth_callbacks_controller.rb
hackathon_manager-0.1.0 app/controllers/users/omniauth_callbacks_controller.rb