Skip to content

Worker Invitation

TeusTan edited this page Jan 8, 2020 · 1 revision

Frontend will send a list of emails (and organization in the future) to endpoint /invite

  • Validates the emails and checks that they are not already part of the organization
  • Populate the Invitation table with the emails with additional information with a token created for each email. Invitation table model should contain the following:
    • Email: str
    • Organization: ForeignKey(organization)
    • Invited _by: ForeignKey(User)
    • Token: str
    • Datetime: datetime
    • Expires_at: datetime
  • Send an email to each one with a link to following link: <humanlambdas-url>/invitation/<email-token>

Once the user clicks the url in the email a GET will request is sent to the URL

  • The token is verified from the backend and the email and organizaton name is returned

The user should fill out the rest of the form which is partially filled with email and organization and then send a POST to same URL

  • This will be similar to register endpoint but sets is_admin to False
Clone this wiki locally