Search code examples
phplaravel-5.1laravel-authorization

Laravel 5.1 Auth not consistent


I am working on a project and did the Laravel 5.1 Authentication. I followed the Documentation. I only have one user, no registration.

Now, when I protect routes I do it this way:

Route::group(array('middleware' => 'auth', 'prefix' => '/admin'), function() 
{ ... }

Then the Login-Form comes back, I authenticate and it is working. But now, when I refresh the page (or go to other admin-pages) sometimes I am logged out and redirected to the login-form again, sometimes I get a "Whoops, looks like something went wrong.", and sometimes it is working for some requests.

I have no idea why and when it is happening. I followed this documentation

When I was working with Laravel 4.* everything was fine.

Did someone have the same problems ?


Solution

  • Fixed - When i logged in, angular was loading like 300 items. Every item tried to load an image, but most of them don't exist. I guess all these failing requests were producing the error. When I remove the img-Tags it's working fine, also when the requested images are existing. Thanks for your help though!!