0

I'm having problems authenticating users using Laravel's builtin auth system.

I have a users table with a username and password fields. I've set up routes with the web middleware to process the authentication and added my protected routes with the auth middleware.

What's strange is that authentication seems to work fine but if i try to access a protected route i get redirected back to the login page.

I checked the $errors in the login page and, if i supply a bad username/password combo i get the standard error message:

These credentials do not match our records.

If i supply valid credentials i get no errors but i'm still redirected to the login page.

I activated Laravel's debugbar to try and track down the problem. With invalid credentials i can see two requests: the first do the login action and the second back to the login form. With valid credentials i can see three requests: the first to the login action, the second to the protected action where it should go after a successful authentication and then a third one back to the login page.

Seems to me that the authentication info is not being stored. With debugbar i can see there is a login_web_59ba36addc2b2f94... variable but with null contents.

Am i missing something here? Any clues?

Thanks in advance.

Moppo
  • 18,797
  • 5
  • 65
  • 64
Gonçalo Marrafa
  • 2,013
  • 4
  • 27
  • 34

0 Answers0