Skip to content

Instantly share code, notes, and snippets.

View Elaray's full-sized avatar

Yahor Yemialyanau Elaray

View GitHub Profile

The system supports inviting both new users (not yet registered in the application) and existing users. The process is based on invitation tokens and time limits.


1. Routes involved in the process

  • POST /account-users/invite – send an invitation to an email.
  • GET /account-users/verify-invite – verify the token and redirect to the correct flow (new or existing user).
  • POST /account-users/accept-invite – accept an invitation for an existing user.
  • POST /account-users/sign-up-from-invite – sign up a new user via invitation.

✅ Overall Architecture

  • There are Users and Accounts:
    • One User can belong to multiple Accounts with roles: Owner, Admin, User.
  • The connection between a user and an account is represented by AccountUser (statuses: ACTIVE, INVITED).
  • There are 4 authentication methods:
    1. Email + Password
    2. Google OAuth
    3. LinkedIn OAuth
  1. Pitchbox OAuth