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 π
Solution:Jump to solution
removing it entirely and just allowing the middleware to check instead fixed it
15 Replies
Do you have any permissions added? From what you say you haven't seeded them
I have seeders, forgot to disclose that
with/without does not change anything
It's something with your permissions
Maybe user has no role/permissions assigned
they do, as I have a blade directive to show the UI element
Remove all the permissions from the code and check if it works. This is local?
I have an is_mentor in the user model that gets checked for
it is local, yeah
How checked? Where?
middleware
I've fixed it, somehow my canAccessPanel was throwing the 403
Solution
removing it entirely and just allowing the middleware to check instead fixed it
thanks for your help!
No. You need to use that method
I took a look at my codebase and figured out that was causing it
not really
Without it in production it won't work
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
Add check for is_mentor in there and ditch the middleware