Superbase New User Creation | which function?

Hi,

I’m trying to enable Admin users to create Other users within the application. As of now If I use Superbase -SignUp function, it will sign-out the current user and authenticate the newly created user.

Hence I was trying to create the new user using Superbase Sign | MagicLink function. It created a new user in Auth.user tables with new ID, yet it returns null to the webapp.

Is there a way around this since I need to identify this user to links some other functions like userRole.
Or any guide to create new users via frontend

Screenshot 2024-01-23 at 00.46.16

Screenshot 2024-01-23 at 00.46.55

When you send a magic link, it sends the link to sign in to the user. What exactly is your need on the frontend? Please specify

Hi,

Basically I need to create New Users from frontEnd, when I use the superbase signup inside my form submit workflow, It creates the user, but sametime it un-autheticate the current user who is already logged in to the frontend

Hi, is “confirm email” enabled on your supabase ? If so, it shouldn’t authenticate the user :thinking:

But I think if something happen during the signup process it will disconnect the current user, that probably not a good behavior, will see to remove it in a future update.

1 Like

Hello was this issue fixed ?

We have the same issue when trying to add a user from an internal form (which is available only for administrators). We tried to use the sign-up function to create a new user but it doesn’t seem to work because the person creating the new user is already logged into their own account. As soon as we send the form the admin user if log ou. How should we proceed?

It’s how the signup function work in supabase, maybe you should try to create a postgres function or an edge function ?

There is an admin feature but it should not be used from the front end according to supabase so we cant implement it as a plugin action (the method we are using to allow you create users from our editor)