N
N
nepster-web2016-04-25 17:59:04
Laravel
nepster-web, 2016-04-25 17:59:04

Laravel5. Why is authentication being interrupted?

I did a double authentication with the help of guards and got very strange behavior:
For example, when I log in to the site, the authentication goes well.
Next, I go to the admin panel, if the user is not logged in there, then authentication on the site is reset.
Moreover, this behavior works on the one hand, that is, the site.
If you log in to the admin panel and go to the site, then everything is okay in any case.
What could be the problem ?
P.S. Cook is placed alone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrzej Wielski, 2016-04-25
@nepster-web

Create a middleware to check access to the admin panel, if it is not there - abort 404
Wrap all admin routes in a group, and attach fresh middleware to it.
Your problem most likely lies in the fact that you have specified access rules in the already used Middleware to check authorization, this is what causes a similar error.
The logic is as follows: an authorized user goes to the admin panel, the system sees that he does not have access, and returns an empty session. The result is an authorization reset.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question