Sha256: 816c21e2afd37f575f6ee28abd165a93abf9f57c48312fbbbbf2aeb4e8cdad08

Contents?: true

Size: 1.19 KB

Versions: 41

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

require 'devise'
require 'devise-encryptable'

module Ibrain
  module Auth
    class Engine < Rails::Engine
      isolate_namespace Ibrain::Auth
      engine_name 'ibrain_auth'
      config.generators.api_only = true

      initializer 'ibrain.auth.environment', before: :load_config_initializers do |_app|
        require 'ibrain/auth_configuration'

        Ibrain::Auth::Config = Ibrain::AuthConfiguration.new
      end

      config.to_prepare do
        ApplicationController.include Ibrain::AuthenticationHelpers
      end

      def self.fallback_on_unauthorized?
        return false unless Ibrain::Config.respond_to?(:fallback_on_unauthorized)

        if Ibrain::Config.fallback_on_unauthorized
          true
        else
          Ibrain::Deprecation.warn <<-WARN.strip_heredoc, caller
            Having Ibrain::Config.fallback_on_unauthorized set
            to `false` is deprecated and will not be supported.
            Please change this configuration to `true` and be sure that your
            application does not break trying to redirect back when there is
            an unauthorized access.
          WARN

          false
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
its-ruby-auth-0.0.1 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.20 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.19 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.18 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.17 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.16 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.15 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.14 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.13 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.12 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.11 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.10 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.9 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.8 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.7 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.6 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.5 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.4 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.3 lib/ibrain/auth/engine.rb
ibrain-auth-0.3.2 lib/ibrain/auth/engine.rb