Janis
Janis4mo ago

Supabase: Invite user over email

I am trying to set up a team invite system with Toddle and Supabase. I created a helper table called team_members in Supabase with a Supabase Insert Trigger node in Buildship. However, I cannot get the API call to properly work. My Invite user over email API call does send an email, however, I cant figure out why the "redirectTo" parameter does not work. Did anyone already build this and provide their node as a template? Here's part of the node: const body = JSON.stringify({ email, options: {"redirectTo": "https://mysite.toddle.site/set-password"}, data: { "full_name": ${first_name}} });
Solution:
Thanks for sharing, send the emailRedirectTo as options. options: { emailRedirectTo: 'https://example.com/welcome' } In the data body, refer to this https://supabase.com/docs/reference/javascript/auth-verifyotp. You can use the Edit with AI feature to modify it for your node...
No description
Jump to solution
9 Replies
AI Support
AI Support4mo ago
To set up a team invite system with Toddle and Supabase in BuildShip, you can follow the steps outlined in the documentation for connecting Supabase with BuildShip. Here are the relevant links for more details: - Connecting Supabase to BuildShip Regarding your issue with the "redirectTo" parameter not working, ensure that the URL you are providing is correct and accessible. Also, make sure that the Supabase settings allow for redirection to the specified URL. If you need a template for this, you can check the BuildShip templates or ask the community for shared templates on the BuildShip platform. If the issue persists, please submit your query via the in-app support button for further assistance.
Visually build with Supabase with low-code and AI – BuildShip
A unified resource to start building your backend with low-code. Dive into triggers, nodes, and step-by-step guidance to jumpstart your workflow creation.
Janis
JanisOP4mo ago
Can you give me the code or an example for the the invite node?
AI Support
AI Support4mo ago
I couldn't find specific documentation about the "invite node" in the BuildShip documentation. For further assistance, please submit your query via the in-app support button.
Gaurav Chadha
Gaurav Chadha4mo ago
@Janis, if the sending email API is working fine, you can modify it include a custom body in it https://supabase.com/docs/reference/self-hosting-auth/sends-an-invite-link-to-the-user. As the API Call node's body will be used for calling the API not for the email body content.
Supabase API reference
Supabase API reference
Gaurav Chadha
Gaurav Chadha4mo ago
To modify you can use edit with AI feature. https://docs.buildship.com/ai-nodes
AI Generated Nodes – BuildShip
A unified resource to start building your backend with low-code. Dive into triggers, nodes, and step-by-step guidance to jumpstart your workflow creation.
Janis
JanisOP4mo ago
@Gaurav Chadha Thanks a lot! Yes, the email is sent fine to the user. However, I just cant figure out why the "redirectTo" parameter doesnt work. I already triple checked that I whitelisted in Supabase. Do you have a node by any chance that I could remix?
Janis
JanisOP4mo ago
It really is just the second step that I'm really struggling with.. So the redirectTo leads should lead to a password-reset page
No description
Janis
JanisOP4mo ago
This is my node
No description
Solution
Gaurav Chadha
Gaurav Chadha4mo ago
Thanks for sharing, send the emailRedirectTo as options. options: { emailRedirectTo: 'https://example.com/welcome' } In the data body, refer to this https://supabase.com/docs/reference/javascript/auth-verifyotp. You can use the Edit with AI feature to modify it for your node
No description