"State Mismatch" Error after Passwordless Authentication
Sep 10, 2025
Overview
----
HandlerError [BadRequestError]: state mismatch, expected eyJyZXR1cm5UbyI6Imh0dHA6Ly9sb2NhbGhvc3Q6MzAwMC9wcm9maWxlIn0, got: hKFo2SBNcy10dmNlSFhsa2ptc2t4SFptUE5MajR6bzlPVkhHeKFupWxvZ2luo3RpZNkgMWh6ZU5CTW9rMmg3dFpXNXA5eTFzRzRHLU9MR2tJWmOjY2lk2SBjTXhxb09STDFkUTZuTEo2S3pnc2dtNE8zRjd3V2dSOA
----
The client is a NextJS app using nextjs-auth0 SDK.
Applies To
- NextJS
- Passwordless Connection
- Authentication with Link
Cause
Solution
-
Enable the Use Custom Domain in Emails toggle.
- Then, initiate the flow with the custom domain in the /authorize request.