Sha256: 6d8fb7e57063eeb7f798511b4c3d17b31e82713c04d9e820c19c768f9ba3bff2

Contents?: true

Size: 1.01 KB

Versions: 12

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

begin
  require "omniauth"
  require "omniauth/version"
rescue LoadError
  warn "Could not load 'omniauth'. Please ensure you have the omniauth gem >= 1.0.0 installed and listed in your Gemfile."
  raise
end

unless OmniAuth::VERSION =~ /^1\./
  raise "You are using an old OmniAuth version, please ensure you have 1.0.0.pr2 version or later installed."
end

# Clean up the default path_prefix. It will be automatically set by Devise.
OmniAuth.config.path_prefix = nil

OmniAuth.config.on_failure = Proc.new do |env|
  env['devise.mapping'] = Devise::Mapping.find_by_path!(env['PATH_INFO'], :path)
  controller_name  = ActiveSupport::Inflector.camelize(env['devise.mapping'].controllers[:omniauth_callbacks])
  controller_klass = ActiveSupport::Inflector.constantize("#{controller_name}Controller")
  controller_klass.action(:failure).call(env)
end

module Devise
  module OmniAuth
    autoload :Config,      "devise/omniauth/config"
    autoload :UrlHelpers,  "devise/omniauth/url_helpers"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
devise-4.7.3 lib/devise/omniauth.rb
devise-4.7.2 lib/devise/omniauth.rb
devise-4.7.1 lib/devise/omniauth.rb
devise-4.7.0 lib/devise/omniauth.rb
devise-4.6.2 lib/devise/omniauth.rb
devise-4.6.1 lib/devise/omniauth.rb
devise-4.6.0 lib/devise/omniauth.rb
devise-4.5.0 lib/devise/omniauth.rb
devise-4.4.3 lib/devise/omniauth.rb
devise-4.4.2 lib/devise/omniauth.rb
devise-4.4.1 lib/devise/omniauth.rb
devise-4.4.0 lib/devise/omniauth.rb