Verify User's Email
Verifies a user’s email address. A verification email is sent upon registration with a link that must be clicked to confirm.
HTTP Request
GET /api/v1/auth/email/verify/:userId/{hash}
| Parameter | Description |
|---|---|
userId string | Unique identifier for the user |
hash string | Verification hash received in the email link |
Response
204 No Content
Indicates the email was verified successfully.
Frontend Integration
When the user clicks the verification link, they are redirected to your frontend. Your app should:
- Capture the
urlparameter from the query string. - Make a
GETrequest to that URL to verify the email. - If the response is
204 No Content, inform the user of successful verification. - Handle potential errors (
409 Conflict,422 Unprocessable Entity,400 Bad Request) appropriately.
Example Verification Link
plaintext
https://brunago.sk/verify-email?url={verificationUrl}Replace {verificationUrl} with the URL from the email.
Example Verification URL
plaintext
https://brunago.sk/verify-email?url=http%3A%2F%2Fapi.brunago.sk%2Fapi%2Fv1%2Fauth%2Femail%2Fverify%2FgqsB7ZR%2Fe05bdf9ce58ac6824eb37ec6ffc6c0d6a31a7901%3Fexpires%3D1715821904%26signature%3D20db38a62ea793d49a07cb04f330d028676a489e81bbb282e30c03c6596eb936Example Password Reset Link
plaintext
https://brunago.sk/reset-password?token=2f6cb81e40a9f0d203cb60119022db8754444a9a9b02eef31adee79403dede3c&email=pavol.paska%40gmail.com(You can customize /verify-email or /reset-password as needed.)
Error Handling
409 Conflict: Email already verified422 Unprocessable Entity: Invalid or expired verification link400 Bad Request: Other verification issues
json
{
"message": "Unable to verify email."
}