Sha256: c11fc9985ffc7bd2492020f66c14e0e2d058b9126f320dba414455684b2f0132

Contents?: true

Size: 877 Bytes

Versions: 3

Compression:

Stored size: 877 Bytes

Contents

class Devise::OmniauthCallbacksController < DeviseController
  prepend_before_filter { request.env["devise.skip_timeout"] = true }

  def passthru
    render :status => 404, :text => "Not found. Authentication passthru."
  end

  def failure
    set_flash_message :alert, :failure, :kind => failed_strategy.name.to_s.humanize, :reason => failure_message
    redirect_to after_omniauth_failure_path_for(resource_name)
  end

  protected

  def failed_strategy
    env["omniauth.error.strategy"]
  end

  def failure_message
    exception = env["omniauth.error"]
    error   = exception.error_reason if exception.respond_to?(:error_reason)
    error ||= exception.error        if exception.respond_to?(:error)
    error ||= env["omniauth.error.type"].to_s
    error.to_s.humanize if error
  end

  def after_omniauth_failure_path_for(scope)
    new_session_path(scope)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devise-2.1.4 app/controllers/devise/omniauth_callbacks_controller.rb
devise-2.1.3 app/controllers/devise/omniauth_callbacks_controller.rb
devise-2.1.2 app/controllers/devise/omniauth_callbacks_controller.rb