-
I'm creating a plugin to check if the user has the right roles to use the API. It works, but it is applying for other endpoints downstream. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
👋 |
Beta Was this translation helpful? Give feedback.
-
At the moment I moved the guard on the main instance waiting for new improvement. |
Beta Was this translation helpful? Give feedback.
Hi @apescione
I'll tell you what I've done not knowing if it is best practice.
I used to inline all my routes on the same Elysia instance. I check the authorisation in a scoped middleware and then check the user's profile in the
beforeHandle
of each route like below