2 years ago

Authentication problem in 5.3

Posted 2 years ago by phpMick

Not sure what I am doing wrong here.

Working through this:

did this:

php artisan make:auth

In my controller I have:


$this->user = Auth::user();

//also tried
  $this->user = auth()->authenticate();

When I step through the code, I can see it hit the line where it assigns to $this->user, then it throws and unauthenticated error.

This gets caught in Handler.php and I get redirected:

    return redirect()->guest('login');

But, I don't go back to login, I seem to go to home somehow.

Why does it keep redirecting to home?


Please sign in or create an account to participate in this conversation.