ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Validate request

    1. Validate request using JSON schema
      1. In case validation fails - generate 422 error
JSON schema
{
   "$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 }

  • lower ( authdb.users.email ) == lower { $.email }

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

Search active invite

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

  • lower ( authdb.invites.email ) == lower { $.email }
  • authdb.invites.expires_at > now ()


If invite found - return authdb.invites.id

Create invite

Using configuration parameter INVITE_EXPIRATION_PERIOD determine expires_at value

  • authdb.invites.expires_at = now () + INVITE_EXPIRATION_PERIOD (seconds)

Add invite record into authdb.invites and return generated authdb.invites.id

  • No labels