Skip to main content

Mark email as verified

Once a SuperTokens user has been created and their userId has been mapped, you need to mark their email as verified, if their email was verified in the old auth provider.

Step 1) Generating the email verification token:#

For example with the email as johnDoe@gmail.com and userId as 056f4b02-c992-42ed-a8af-cb709669bbd

curl --location --request POST '/recipe/user/email/verify/token' \
--header 'api-key: ' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
"email": "johnDoe@gmail.com",
"userId": "056f4b02-c992-42ed-a8af-cb709669bbd"
}'

Successfully generating an email verification token will result in the following response

{
"status":"OK",
"token":"OWU2OGQyZWQ5MGFkMzM1M2Y4ZDMzNjE1NzA4ZGI0YWYyODEwMzg0NjJhNTcxNDZjYmY0NzJiOTZmYWE5OTJkMzRmOWVkYzBiODZkMWNmYTJkY2I5YWJkZDU2Yjg0NTU0"
}

Step 2) Verifying the users email with the verification token#

Retrieve the token from the response of the previous request and set it in the body of the email verification request.

curl --location --request POST '/recipe/user/email/verify' \
--header 'api-key: ' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
"method": "token",
"token": "OWU2OGQyZWQ5MGFkMzM1M2Y4ZDMzNjE1NzA4ZGI0YWYyODEwMzg0NjJhNTcxNDZjYmY0NzJiOTZmYWE5OTJkMzRmOWVkYzBiODZkMWNmYTJkY2I5YWJkZDU2Yjg0NTU0"
}'