Resend invite
Hey,
I've got 2 different types of users, those who sign-up directly and then those who get invited by the people who've signed up.
I've had quite a few invited users stung by the token expiring before they've got round to following the link in the email.
I've extended the time limit in the dashboard to give myself extra time, but for users already affected, I can't see that there is any way to resend the invite email.
I've got a function written using
@supabase/js
package using supabase.auth.resend
but the valid types are only signup
, password_change
, email_change
and sms
My invite email template is different to my signup email template and the links they go to using the redirectTo
perform slightly different things and trigger different edge functions so it's imperaitve I re-send the right template.
Am I missing something or is this just not possible for invited users to get the inivte email a 2nd time?8 Replies
Have you tried just inviting them again? Maybe delete and invite from the dashboard?
https://supabase.com/docs/reference/javascript/auth-admin-inviteuserbyemail
JavaScript: Send an email invite link | Supabase Docs
Supabase API reference for JavaScript: Send an email invite link
Hey, no I haven't I'd need to write an edge function I think as there are 3rd party services linked to the user too, plus a load of records in other tables in SB that all would trigger cascades from the deletion and I'm really keen to avoid that if possible as all I want to do is re-send the invite email with a new token as the old ones expired.
Why does a user that has not confirmed have all this data associated with them?
I'm not sure how you are sending email invite and the signup template did not go out. If the user does not exist then magic link invite should send the signup template not the magiclink template.
How exactly are you creating and inviting the user?
Also this topic is getting stale in the scheme of things and you should feel free to ask again as I doubt a user with more experience in Auth options might answer.
Feel like I've muddied the water a bit, and have taken on board about re-asking, will look to do this soon.
But for some clarity.
Our product has 2 tiers of users, for simplicity I will refer to them as primary and secondary,
Primay users can register themselves after purchasing from us and their accounts are created using the
sb.auth.admin.createUser
function.
Primary users can also add additional people to share their purchased product by inviting them as secondary users whose accounts are created with the sb.auth.admin.inviteUserByEmail
function.
What I'm having issues with is tokens expiring as secondary users don't always answer in time, and then I can't see in the sb.auth.resend
function any means of resending a type: "invite"
email which is what the secondary users were created with in the first instance.
The "invite user" email template in SB has some extra detail and goes to a different link on our app than the "confirm signup" one, I just want to resend the email the secondary user originally got but with a valid tokenHave you tried just resending the invite?
https://github.com/supabase/auth/issues/312
That is mentioned in here.
GitHub
[Feature request] auth.resendConfirmationEmail · Issue #312 · sup...
Feature request Is your feature request related to a problem? Please describe. Occasionally, users don't receive email confirmation emails, or the emails go to spam. Or they may have created an...
Yeah that doesn't support
type: "invite"
No, there is a comment about just doing the admin invite again in there. Or missed what the comment meant.
Also it seems they are discussing your issue there and if there is no solution discovered….
Hey https://github.com/supabase/auth/pull/2058 this pull request supposedly fixes the issue but I still cannot resend an invitation link to a already existing user (I get the same error in the git issue). It doesnt work in the dashboard and in supabase-js (supabase.auth.admin.inviteUserByEmail).
GitHub
fix: invites should send another email when user exists by cstockto...
Added a test for double invites
Fixed control flow to send another invite
Bug introduced in:
#2034
Fixes:
#2057