how can I check if an user has permission to access a page?
Answered
ADNerf posted this in #help-forum
ADNerfOP
The question says it all. I'm using PocketBase in case it helps
Answered by B33fb0n3
You can use a middleware for it. Configure your matcher, so it only matches the protected pages and check the user permissions in your middleware. If the user is authorized, dont do anything. Else redirect him to
/5 Replies
ADNerfOP
I want the user to be send back to the home page "/" if they do not have permission to access x page
@ADNerf The question says it all. I'm using PocketBase in case it helps
You can use a middleware for it. Configure your matcher, so it only matches the protected pages and check the user permissions in your middleware. If the user is authorized, dont do anything. Else redirect him to
/Answer
@ADNerf solved?
ADNerfOP
Yes it worked, thank you very much!
happy to help