[!NOTE]
This behaviour is for local environment only,
For non-logged in users:
Whenever a user invites another user, we create a token and append it to the invite url: http://localhost:3000/app/invite?token=xyz. The user will get redirected to /app/login?redirectTo=http://localhost:3000/app/invite?token=xyz.
If using GitHub or Google, all good.
If using Magic Link, Resend with attach two new search params: token and callbackUrl=app/login.
To avoid the confusion, we can rewrite token to access-token e.g. but there is still the issue of the callbackUrl that weights heigher than the redirectTo and redirects to /app/login after clicking the magic link instead of /app/invite?token=xyz - losing the user flow.
For logged in users, the will access immediately /app/invite?token=xyz and accept the invitation.
Description
For non-logged in users:
Whenever a user invites another user, we create a token and append it to the invite url:
http://localhost:3000/app/invite?token=xyz
. The user will get redirected to/app/login?redirectTo=http://localhost:3000/app/invite?token=xyz
.If using GitHub or Google, all good.
If using Magic Link, Resend with attach two new search params:
token
andcallbackUrl=app/login
.To avoid the confusion, we can rewrite
token
toaccess-token
e.g. but there is still the issue of thecallbackUrl
that weights heigher than theredirectTo
and redirects to/app/login
after clicking the magic link instead of/app/invite?token=xyz
- losing the user flow.For logged in users, the will access immediately
/app/invite?token=xyz
and accept the invitation.