dimanche 4 juin 2017

Laravel auth() returns false on 404's

I had an issue with Laravel when it throws a 404 exception, or any kind of exception, the auth() helper returns null in these pages, 404, 400... any exception.

as someone suggested i moved 2 middlewares to the globalgroup

 \App\Http\Middleware\EncryptCookies::class,
 \Illuminate\Session\Middleware\StartSession::class,

however it caused another issue, it was logging me out everytime i refresh the page, when i moved these middlewares back logged in users stay logged in.

so now, i still need a way to use auh(), in 404 pages, it makes no sense that the navbar displays Please Login on 404 pages when the use is already logged in, that's really bad Laravel.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qNWGKD
via IFTTT

Aucun commentaire:

Enregistrer un commentaire