-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass request
to withMiddlewareAuth
's isPermitted
function
#308
Comments
Yes! I have the same use case (check if user has role to access certain page). I used to do it via With the new The lines to change should be:
and
I may open a PR targeting the |
Sorry for my late follow up, I have written the code for Changes from If someone could point me to how I could also have this update for Supabase v1, that'd be great. If not, please tell me so I could adapt the code for latest main branch. |
I just saw a new PR #364 which would solve this issue. Looking forward to it! |
Feature request
Is your feature request related to a problem? Please describe.
I like the functionality of the
withMiddlewareAuth
helper, but in my use case I'm a bit limited. I would like to have multiple paths where I check the user authentication and for each I would like to check for a different user role.Describe the solution you'd like
Referring to the following code, I would suggest to pass the
request
in theisPermitted
function, so that we could check also for the url and be more specific.https://github.com/supabase/auth-helpers/blob/main/examples/nextjs/middleware.ts#L1-L15
The text was updated successfully, but these errors were encountered: