Forum General Authentication problem in 5.3
Not sure what I am doing wrong here.
Working through this:
https://laravel.com/docs/5.3/authentication
did this:
php artisan make:auth
In my controller I have:
$this->middleware('auth'); $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?
Mick
Please sign in or create an account to participate in this conversation.
There's no shortage of content at Laracasts. In fact, you could watch nonstop for days upon days, and still not see everything!
Get Started
Authentication problem in 5.3
Not sure what I am doing wrong here.
Working through this:
https://laravel.com/docs/5.3/authentication
did this:
In my controller I have:
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:
But, I don't go back to login, I seem to go to home somehow.
Why does it keep redirecting to home?
Mick