Closed neatonk closed 8 months ago
Much of this functionality is provided by the supabase auth control panel.
One option is to implement collaborator-only accounts account metadata:
collaborator: true
or similar to metadata when creating a new collaborator account.collaborator: true
or similar from metadata to remove upgrade to normal user.An alternative would be to implement collaborator accounts using a separate table
Add a new account of the specified type for the given email address. Send an email invite link to the email address.
In my testing, this is not very smooth yet. It may be necessary to update the email templates to avoid the implicit auth flow and/or support the implicit auth flow in the client. By default the invite and confirmation emails redirect back to the app with something like this, which we do not currently handle:
https://mesa-wallet.vercel.app/en#access_token=<TOKEN_HASH>&expires_at=1698556517&expires_in=3600&refresh_token=<REFRESH_TOKEN>&token_type=bearer&type=invite
See https://supabase.com/docs/guides/auth/server-side/email-based-auth-with-pkce-flow-for-ssr#update-email-templates-with-url-for-api-endpoint, for example.
Closing in favor of using the Supabase auth dashboard to manage users. As discussed on our call today, signups will be open to all and there will be no restricted collaborator role. See #32
\/admin\/users → Admin page for user management. (1 day)