Going to any page returns 403

Whenever I try to go to any panel, it returns a 403. There is no error or anything so I have no idea on how to debug this. Ever since I did a refresh of my database this issue has been happening. Any ideas on how I can potentially fix this? Cheers πŸŽ‰
No description
Solution:
removing it entirely and just allowing the middleware to check instead fixed it
Jump to solution
15 Replies
krekas
krekasβ€’5mo ago
Do you have any permissions added? From what you say you haven't seeded them
Supernova3339
Supernova3339β€’5mo ago
I have seeders, forgot to disclose that with/without does not change anything
krekas
krekasβ€’5mo ago
It's something with your permissions Maybe user has no role/permissions assigned
Supernova3339
Supernova3339β€’5mo ago
they do, as I have a blade directive to show the UI element
krekas
krekasβ€’5mo ago
Remove all the permissions from the code and check if it works. This is local?
Supernova3339
Supernova3339β€’5mo ago
I have an is_mentor in the user model that gets checked for it is local, yeah
krekas
krekasβ€’5mo ago
How checked? Where?
Supernova3339
Supernova3339β€’5mo ago
middleware I've fixed it, somehow my canAccessPanel was throwing the 403
Solution
Supernova3339
Supernova3339β€’5mo ago
removing it entirely and just allowing the middleware to check instead fixed it
Supernova3339
Supernova3339β€’5mo ago
thanks for your help!
krekas
krekasβ€’5mo ago
No. You need to use that method
Supernova3339
Supernova3339β€’5mo ago
I took a look at my codebase and figured out that was causing it not really
krekas
krekasβ€’5mo ago
Without it in production it won't work
Supernova3339
Supernova3339β€’5mo ago
if the method isn't visible it will always throw that hmm your right yeah hold on, I'll fix that fixed it! all I really did is have it allow any user with a verified email, which is an essentially "allow all" horrible practice, but due to middleware and marking email as verified upon registration, its a working solution
krekas
krekasβ€’5mo ago
Add check for is_mentor in there and ditch the middleware