Versions Compared

Key

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

...

  1. Search in the registration_request by id and email
    1. return error if not found
  2. Check employee's signature using public_key and data from the payload
    1. error
  3. Check the creator's signature using the creator's public key and data from the payload. Employee should sign the same dataset as it has been created by creator.
    1. error
  4. search user inĀ Auth
    1. if not found - create new user record
    2. if found - check that $payload.public_key = $user.public_key
      1. if true - update user profile
      2. if false - return error "email has been registered already for another user"
  5. create new employee record - call