Developers/Workflow/User Invitation Flow

From wiki.storlye.com
Revision as of 09:32, 15 June 2026 by Wikistorlye admin (talk | contribs) (Protected "Developers/Workflow/User Invitation Flow": Developers area managed by admins ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Jump to navigationJump to search

Developers/Workflow/User Invitation Flow

This page describes the current invitation flow used by Storlye.

Purpose

Allow a superadmin to invite a new user by email, WhatsApp context, or QR sharing using the same invitation token context in the active modal.

Entry Points

  • POST /v1/admin/invitations/preview-link
  • POST /v1/admin/invitations/send
  • POST /auth/signup (with optional inviteToken)
  • POST /auth/signup-confirmation/verify
  • GET /v1/widgets/pending-people-invites
  • PATCH /v1/user-connections/:connectionId/respond-me

Flow

  1. Superadmin opens invite modal.
  2. Frontend requests POST /v1/admin/invitations/preview-link.
  3. Backend creates a pending invitation row in user_invitations with token hash and TTL, then returns invitationId, inviteToken, and inviteLink.
  4. Frontend renders a QR code from the invite link. The link is already valid before pressing Send.
  5. If Send Invite is pressed, frontend calls POST /v1/admin/invitations/send reusing invitationId plus inviteToken and optional contact fields (email/whatsapp).
  6. Backend updates or creates invitation data and returns final inviteLink. If email is provided, email delivery is attempted.
  7. Invitee signs up using inviteToken in POST /auth/signup.
  8. Invitation status moves to signup_pending_confirmation and gets associated with invited user id.
  9. Invitee confirms account with POST /auth/signup-confirmation/verify.
  10. Backend attaches pending connection based on invitation context.
  11. Invitee can accept or decline in pending people invites widget via PATCH /v1/user-connections/:connectionId/respond-me.

Data Notes

  • user_invitations stores token hash (never plain token), contact channels, status lifecycle, and inviter/invitee references.
  • user_connections is updated after signup confirmation and finalized on invite response (confirmed or declined).

Current Behavior

  • QR and Send in the same modal reuse the same token context.
  • WhatsApp is stored as invitation context; automatic WhatsApp delivery is not integrated yet.

Maintenance Rule

  • Update this page in the same change cycle whenever invitation endpoints, statuses, or flow steps change.

Last update: 2026-06-15 14:32:05 UTC