Skip to content

Verify email by code

GET
/users/email/verification

Will verify the email by the code sent in query param, and redirect to success or failed page

Flow:

  1. Validate request.
    - code is required. this is coming from the email verification link query param.
    - Validate the code is a valid jwt token.
  2. Decode the jwt token and get the email and userId from the claims.
  3. Validate the email and userId are present in the claims.
  4. Validate the email is a valid email.
  5. Check if the email is already used by another user and is verified. If yes, return 400 email already registered.
  6. Update the user email and email status to verified.
  7. Publish the AUTH_USER_UPDATED event.
  8. Redirect to email verification success page.
code
string

Jwt token containing email and user id

Found