Class: Spree::Auth::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Spree::Auth::Engine
- Includes:
- SolidusSupport::EngineExtensions
- Defined in:
- lib/spree/auth/engine.rb
Class Method Summary collapse
Class Method Details
.prepare_backend ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/spree/auth/engine.rb', line 51 def self.prepare_backend Spree::Admin::BaseController. = -> do if spree_current_user flash[:error] = I18n.t('spree.authorization_failure') if Spree::Auth::Engine. redirect_back(fallback_location: spree.) else redirect_to spree. end else store_location if Spree::Auth::Engine. redirect_back(fallback_location: spree.admin_login_path) else redirect_to spree.admin_login_path end end end end |
.prepare_frontend ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/spree/auth/engine.rb', line 74 def self.prepare_frontend Spree::BaseController. = -> do if spree_current_user flash[:error] = I18n.t('spree.authorization_failure') if Spree::Auth::Engine. redirect_back(fallback_location: spree.) else redirect_to spree. end else store_location if Spree::Auth::Engine. redirect_back(fallback_location: spree.login_path) else redirect_to spree.login_path end end end end |
.redirect_back_on_unauthorized? ⇒ Boolean
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/spree/auth/engine.rb', line 33 def self. return false unless Spree::Config.respond_to?(:redirect_back_on_unauthorized) if Spree::Config. true else Spree::Deprecation.warn <<-WARN.strip_heredoc, caller Having Spree::Config.redirect_back_on_unauthorized set to `false` is deprecated and will not be supported in Solidus 3.0. 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 |