Create a user from the dashboard. #22067
|
Hello, I have a dashboard in my app through which I can add new users to the app. I understand that the signUp function should be used so that they go to auth.users and trigger the configured triggers. But when I test the functionality, it automatically logs me in to the new account I created from the superadmin, so it logs me out of superadmin, so to speak, and shows me the home for the created user. The code I used is as follows: Is this the correct way to add new users from the app's administrator dashboard? |
Replies: 2 comments 5 replies
|
You should look at admin.createUser https://supabase.com/docs/reference/javascript/auth-admin-createuser . Note it has to be run server side as it needs service_role key. |
|
@ricardosikic yes its working thanks because now i am using the service_role_key instead of the anon and one more question when i deploy the vercel code i found the error "This Edge Function has crashed." but on my local machine everything is fine can you help me |
You should look at admin.createUser https://supabase.com/docs/reference/javascript/auth-admin-createuser .
Note it has to be run server side as it needs service_role key.