# ERROR \[auth\] Failed to handle callback from auth0 \[error\]: Invalid request, an initial state could not be found

**URL:** <https://community.auth0.com/t/error-auth-failed-to-handle-callback-from-auth0-error-invalid-request-an-initial-state-could-not-be-found/61320>\
**Category:** Get Help\
**Created:** [April 19, 2021, 3:49am UTC](https://community.auth0.com/t/error-auth-failed-to-handle-callback-from-auth0-error-invalid-request-an-initial-state-could-not-be-found/61320 "2021-04-19T03:49:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanulledu28](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lanulledu28/32/14673_2.png) [@lanulledu28](https://community.auth0.com/u/lanulledu28)\
**Post date:** [April 19, 2021, 3:49am UTC](https://community.auth0.com/t/error-auth-failed-to-handle-callback-from-auth0-error-invalid-request-an-initial-state-could-not-be-found/61320/1 "2021-04-19T03:49:25Z")

</div>

When my user (who doesn’t have create yet an account) clicks on an invitation link, it get redirect to redirect\_uri [http://localhost:3000/api/auth/auth0/callback](http://localhost:3000/api/auth/auth0/callback)

But it failed by this message error.  
ERROR [auth] Failed to handle callback from auth0 [error]: Invalid request, an initial state could not be found

```
    try {
	await auth0.handleCallback(req, res); // callback here
} catch (err) {
	error( "Failed to handle callback from auth0", err);
    }

```

What I am doing wrong?  
The invitation link looks that :  
[https://mydomain.au.auth0.com/passwordless/verify\_redirect?scope=openid&response\_type=token&redirect\_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fauth%2Fauth0%2Fcallback&verification\_code=XXXXX&connection=email&client\_id=XXXXXXX&email=XXXXX](https://mydomain.au.auth0.com/passwordless/verify_redirect?scope=openid&response_type=token&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fauth%2Fauth0%2Fcallback&verification_code=XXXXX&connection=email&client_id=XXXXXXX&email=XXXXX)

@auth0/nextjs-auth0 0.16.0

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 19, 2021, 7:47am UTC](https://community.auth0.com/t/error-auth-failed-to-handle-callback-from-auth0-error-invalid-request-an-initial-state-could-not-be-found/61320/2 "2021-04-19T07:47:49Z")

</div>

Hey there!

Can I ask you to open this as a GitHub issue in the nextjs-auth0 repo? Once you do that please share the link to the issue here so we can ping repo maintainers. Thank you!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 29, 2021, 12:30pm UTC](https://community.auth0.com/t/error-auth-failed-to-handle-callback-from-auth0-error-invalid-request-an-initial-state-could-not-be-found/61320/3 "2021-04-29T12:30:17Z")

</div>


