I'm creating something like BackOffice (BO) system. Will explain from the beginning.
There are 2 sites.
- Front site.
- BO site.
On front site made default Laravel auth. On BO site made api auth over Laravel passport, and another kind of authentication (in BO site players and users could be logged in, I used guard 'players' and guard 'users').
users could login over default auth (has DB table users) players could login only after request passed auth:api middleware.
Registration. Player fill form on front site - new record on the front site is created. Then front site makes api call to BO site (over laravel passport) with that new registered player data. BO site check in auth:api if all is ok - then creates new record in BO site for that new player. On this stage all is ok.
Login. Player make auth on front site - all is ok, after front site makes api call to BO site for login. in BO also login is ok, I see dump with that player data (did Auth::guard('players')->login()).
Then I make another api call to BO (for example to logout player). At the beginning of the action I check Auth::guard('players') - and it's null. Only guard('api') is not null, but guard('players') null.
Can't figure out what's wrong: of previous login request I had player guard, but after 2 seconds I make logout call - players guard null.
Thanks.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2gFeX9q
via IFTTT
Aucun commentaire:
Enregistrer un commentaire