Class: Ibrain::Auth::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/ibrain/auth/engine.rb

Class Method Summary collapse

Class Method Details

.fallback_on_unauthorized?Boolean

Returns:

  • (Boolean)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ibrain/auth/engine.rb', line 23

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