Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Validate request

    1. Validate request using JSON schema
      1. In case validation fails - generate 422 error
Code Block
languagexml
titleJSON schema
collapsetrue
{
   "$schema":"http://json-schema.org/draft-04/schema#",
   "definitions":{

   },
   "properties":{
      "email":{
         "type":"string",
         "format":"email"
      },
      "data":{
         "properties":{

         },
         "type":"object",
         "additionalProperties":true
      }
   },
   "type":"object",
   "additionalProperties":false
}


Search user using requested email

Search user record in authdb.users using requested { $.email }

...

If record found - return USER_EXISTS error (including authdb.users.id)

Search active invite

Search pending invite in authdb.invites using requested {$.email}

...


If invite found - return authdb.invites.id

Create invite

Using configuration parameter INVITE_EXPIRATION_PERIOD determine expires_at value

...