Skip to content

CanCan auth-fails redirect from backend to frontend login path #371

@bxt

Description

@bxt

So spree_auth_devise already patches Spree::Admin::BaseController#unauthorized such that unauthorized actions go to the backend login form.

However, when the authorization failures come from exceptions from CanCan's authorize! method, spree calls a method named redirect_unauthorized_access. So if you access certain backend features, you might be redirected to the frontend login instead.

Maybe a alias_method :redirect_unauthorized_access, :unauthorized in the admin_controller_decorator would already fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions