Are there any options to add custom payload if the...
# help
w
Are there any options to add custom payload if the user signs up? I have basic users and I have business users (distinction is just a boolean in a mapping table that the user can't edit). The usecase is, that If a business user registers, I'd like to redirect him somewhere else to finish the signup. (I'm using nextjs, so I could have a custom API register route that adds the data to the mapping table, once the user invite was created, but maybe there is a more elegant solution. Vercel functions are incredible slow ^^ (1-2seconds to boot up))
n
Hello @wiesson! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
s
you can pass the entire payload to edge functions and do sign up from deno env and return the response? not sure if its possible
n
wiesson (2022-04-05)
s
How do you determine if a user is a business user?
w
A boolean in a mapping table
(so the user can't update that value)
s
Yes but at the time of signup how is this determined? Is there a checkbox or dropdown on the signup page or do they have a separate signup page?
w
ah, ok. I have a separate signup page / route
Actually I was thinking that I start with an invite only process, which means I create business customers ahead of their registration and they can obtain their data via email. (Magic link, or pw reset)
s
In your application code you can specify the redirect url as part of the second argument and redirect to user to any page after the signup process is done.
Copy code
js
await supabase.auth.signUp({ email, password }, { redirectTo: 'full_url_path' })
Since you would know the user type from the separate sign up page, you can change that
redirectTo
url to wherever you want it to go after the user has finished signing up. Do note that the
redirectTo
url is the one that is sent in the email confirmation email.