Sylius: When not "admin-logged", /admin redirects to /login

Created on 21 Sep 2016  路  11Comments  路  Source: Sylius/Sylius

... I guess it should rather redirect to /admin/login, no ?

It's the case on the demo site, too.

Admin

Most helpful comment

Why don't we just change the pattern from /admin/.* to /admin.*? :)

All 11 comments

Unfortunately, Symfony is incredibly strict with its firewalls paths patterns and as it's configured now, you will be redirected to /admin/login after accessing /admin/ not /admin.

How about creating a redirect route?

sylius_admin_panel:
    path: /admin
    defaults:
        _controller: FrameworkBundle:Redirect:redirect
        route: sylius_admin_dashboard
        permanent: true

Why don't we just change the pattern from /admin/.* to /admin.*? :)

Wouldn't it match e.g. /adminstrable-product-permalink? I know there are little words starting with admin, but still we can have e.g. static pages like /administering-something etc.

(/admin/.*|/admin$) ?

/admin(?:/.*)?$?

Waiting for PR with proper fix 馃槃

@michalmarcinkowski done

I think redirect route should still be created.

With this patch, but without the redirect route, /admin correctly redirects to /admin/login, but then after login, it gets redirected back to /admin which doesn't work.

@emodric Good catch! @lchrusciel Care to submit another PR? Thanks!

@pjedrzejewski sure, I am on that.

Was this page helpful?
0 / 5 - 0 ratings