When a user who already has a CTRL account is invited to a new study, the current flow is rough:
Suggested fix
The accept-invite flow for existing users already works in the dashboard (GET /invites/pending + POST /invites/{inviteId}/accept + StudyInvites.tsx). Simplest fix would be at the email-sending step in sendInvite (application/backend/src/controllers/ParticipantsController.ts):
- If a user with the recipient's email already exists: send a "you've been invited to , please log in to accept in your dashboard" email with a login link
- If not: send the current registration email with the /register/{inviteId} link

When a user who already has a CTRL account is invited to a new study, the current flow is rough:
Error Registering: emailHash already in use. That raw DB-ish message comes fromapplication/backend/src/middlewares/ErrorHandler.tsusing the Prisma unique constraint column name as-is, and shouldn't be exposed to end users. Having users fill the entire form only to fail on submit is bad UX too.GET /invites/pending+StudyInvites.tsx).Suggested fix
The accept-invite flow for existing users already works in the dashboard (
GET /invites/pending+POST /invites/{inviteId}/accept+StudyInvites.tsx). Simplest fix would be at the email-sending step insendInvite(application/backend/src/controllers/ParticipantsController.ts):