Table of Contents |
---|
Validate request
- Validate request using JSON schema
- In case validation fails - generate 422 error
- Validate request using JSON schema
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "$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
...