Invitation + user creation
I'm struggling so hard to figure out a flow where an admin from an org can send an invite and within a single email sent the user be able to authenticate + accept the invite. This user is guaranteed to not have an account yet.
how can I do this? isn't it a common enough flow? am I missing something here?
4 Replies
My thought was combine magic link with createInvitation but doesn't seem straight forward
The flow that comes to mind is as follows:
1. The organization administrator invites a user by entering their email address.
2. The system checks whether a user with that email address already exists.
3. If the user does not exist:
- An invitation is created.
- A magic link is generated with a
callbackURL that includes the invitation ID.
4. When the user clicks on the magic link:
- Their account is automatically created (if it does not already exist).
- They are authenticated.
- The application redirects them to /accept-invitation, where the invitation is accepted.App Invite | better-auth-extended
Invite users to your application and allow them to sign up.
I went with a flow very similar to this except I just create manually the invitation and the token, put them in a single link and send it to the user as email, so far seems to be working
this seems like what I was looking for, wish it was supported on org plugin by default