then this is just a GraphQL mutation that you invoke via a form submit pretty much the same way you would Create a Contact in the tutorial here: Saving Data | RedwoodJS Docs
except instead of creating a contact, you are inviting the user where the form submit sends the email address
@0x1a4f7d58 My question about the above example is in user.create the invited user is being connected to the current user ā arenāt these different people?
Alice invites Bob and Bob is created but connected to Aliceās account
Also, just because someone is invited, does not mean they have accepted.
Instead, you could use Supabaseās new webhooks to trigger when a user has confirmed their invite, then post to a webhook serverless function that ā¦ well ā¦ wouldnāt user be created already by Supabase in their auth.users?
Instead might you to update your users table with a trigger from auth.users and then in the webhook, update to connect ā¦ well, I am not sure what connecting to an account means.
In any case, I think there are a few considerations to check with this flow.
Hi @dthyresson Thanks for your comments. Yes, in this case, an Account can have multiple users. So Alice creates an account and then invites her colleague Bob. I havenāt yet introduced Roles but intend to do so (e.g. Alice as Admin and Bob as User.)
Good to know about the webhooks! Iāll check those out. I had just started to think about how I could tell if Bob is confirmed or notā¦ If I could update based on a trigger from auth.users that would be awesome.