auth()->user( ) returns null in shouldRegisterNavigation()
auth()->user() returns null in shouldRegisterNavigation() method on a custom dashboard.
Seems like the user is not authenticated before that method is called.
6 Replies
@Dan Harrin
so the redirect is happening from mount() of Login page
and it only happens if Auth::check() is true
Solution
so i have no clue why that would be null
do you have a custom auth guard?
Damn... You're right!
I am using a custom guard. Defining the guard on the auth() call fixes the issue.
Can't believe I didn't think of that 🤦♂️