openstatusHQ / openstatus

🏓 The open-source synthetic monitoring platform 🏓
https://openstatus.dev
GNU Affero General Public License v3.0
6.23k stars 398 forks source link

[DEV-MODE]: Resend `callbackUrl` when inviting a new member (for testing) #822

Open mxkaske opened 5 months ago

mxkaske commented 5 months ago

Description

[!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.