How to set up consistent authorization across different plugins?
Hi, I need help setting up consistent authorization for my app.
This is how I'm calling it in the frontend:
I want to know what are my options to mitigate this problem (and if there is something that I'm doing wrong).
- Tech stack: The app is a Tanstack Start App set up just as described here https://www.better-auth.com/docs/integrations/tanstack.
- The app: The app itself is meant to be used as a internal tool for a company, We (me and the admins) need to have strict control on the users that sign up to the app. The sign up flow that best suits my use case is:
- I create a superuser for myself.
- I invite the admins using the magic link (this also crates their users)
- They invite with the same flow the rest of the users and manage them with a dashboard.
- The problem: The **POST /sign-in/magic-link** endpoint (used to send the invite and create the users) doesn't check if you're an admin (that's what I need). In fact it doesn't even check if you're authenticated meaning that anyone can create a user for themselves.
This is how I'm calling it in the frontend:
I want to know what are my options to mitigate this problem (and if there is something that I'm doing wrong).