Sha256: e8f50fe273139c68704b9ded3340b0b0280592dbecc4357a76dcad7292c7d888

Contents?: true

Size: 940 Bytes

Versions: 11

Compression:

Stored size: 940 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: OmniAuth::Utils.camelize(failed_strategy.name), 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

  def translation_scope
    'devise.omniauth_callbacks'
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
devise-3.5.10 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.9 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.8 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.7 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.6 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.5 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.4 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.3 app/controllers/devise/omniauth_callbacks_controller.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/devise-3.5.2/app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.2 app/controllers/devise/omniauth_callbacks_controller.rb
devise-3.5.1 app/controllers/devise/omniauth_callbacks_controller.rb