Class: Spree::UnauthorizedRedirectHandler
- Inherits:
-
Object
- Object
- Spree::UnauthorizedRedirectHandler
- Defined in:
- app/models/spree/unauthorized_redirect_handler.rb
Overview
This service object is responsible for handling unauthorized redirects
Instance Method Summary collapse
-
#call ⇒ Object
This method is responsible for handling unauthorized redirects.
-
#initialize(controller) ⇒ UnauthorizedRedirectHandler
constructor
A new instance of UnauthorizedRedirectHandler.
Constructor Details
#initialize(controller) ⇒ UnauthorizedRedirectHandler
Returns a new instance of UnauthorizedRedirectHandler.
8 9 10 |
# File 'app/models/spree/unauthorized_redirect_handler.rb', line 8 def initialize(controller) @controller = controller end |
Instance Method Details
#call ⇒ Object
This method is responsible for handling unauthorized redirects
13 14 15 16 |
# File 'app/models/spree/unauthorized_redirect_handler.rb', line 13 def call flash[:error] = I18n.t('spree.authorization_failure') redirect_back(fallback_location: "/unauthorized") end |