F
Filament13mo ago
Archy

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.
Solution:
so i have no clue why that would be null
Jump to solution
6 Replies
Archy
ArchyOP13mo ago
@Dan Harrin
Dan Harrin
Dan Harrin13mo ago
so the redirect is happening from mount() of Login page and it only happens if Auth::check() is true
Solution
Dan Harrin
Dan Harrin13mo ago
so i have no clue why that would be null
Dan Harrin
Dan Harrin13mo ago
do you have a custom auth guard?
Archy
ArchyOP13mo ago
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 🤦‍♂️
Dan Harrin
Dan Harrin13mo ago
wwesmart
Want results from more Discord servers?
Add your server