Skip to content

How to protect certain routes based on user privileges? #3147

Closed Answered by IGassmann
MrMoneyInTheBank asked this question in Questions
Discussion options

You must be logged in to vote

Hey @MrMoneyInTheBank!

You can implement this functionality by storing the user privilege in the user's public metadata, which you can then embed in the session token as a claim. With that done, you will be able to check for the existence of the privilege in afterAuth() without performing a network request. Here are two guides on how to implement all of this:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MrMoneyInTheBank
Comment options

Answer selected by MrMoneyInTheBank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants