# Checks.state argument is missing in next.js

**URL:** <https://community.auth0.com/t/checks-state-argument-is-missing-in-next-js/70639>\
**Category:** Get Help\
**Created:** [October 1, 2021, 6:13pm UTC](https://community.auth0.com/t/checks-state-argument-is-missing-in-next-js/70639 "2021-10-01T18:13:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hussamkhatib](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hussamkhatib/32/30961_2.png) [@hussamkhatib](https://community.auth0.com/u/hussamkhatib)\
**Post date:** [October 1, 2021, 6:13pm UTC](https://community.auth0.com/t/checks-state-argument-is-missing-in-next-js/70639/1 "2021-10-01T18:13:56Z")

</div>

I am getting an error when trying to login using auth0 while in production.

 ![Screenshot (92)](https://global.discourse-cdn.com/auth0/original/3X/3/d/3d6cc1eb30cbf57d787cbd6f7c8b9af45e11e934.png)  
This seems as a common problem other users have faced as there is already similar question asked before , I wasn’t able to resolve with alone.

Another strange is that the url is changed to `localhost:3000` after login (when error occurs)

code : [GitHub - hussamkhatib/Job-Fynd: An Open Source alternative of Bizotic](https://github.com/hussamkhatib/tap)  
depolyed : vercel  
browser’s tested : chrome (with incoginto as well), edge  
framework : next.js

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [October 15, 2021, 10:35pm UTC](https://community.auth0.com/t/checks-state-argument-is-missing-in-next-js/70639/3 "2021-10-15T22:35:05Z")

</div>

Hi @hussamkhatib,

Thanks for reaching out to the Auth0 Community!

I understand that you’ve been encountering the `checks.state argument is missing` error.

There are a couple of things I’d like you to try and see if it fixes the issue:

1. Please double check that you have configured your Vercel **Environment Variables** correctly? See [here](https://github.com/auth0/nextjs-auth0/blob/main/examples/README.md#configuring-vercel).
2. Could you please make sure that your **Allowed Callback URLs** and **Allowed Logout URLs** are configured correctly in your Auth0 Dashboard? See [here](https://github.com/auth0/nextjs-auth0/blob/main/examples/README.md#configuring-auth0-1).

Looking forward to your response.

Thank you.

---

<div class="post-metadata">

**Author:** ![hussamkhatib](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hussamkhatib/32/30961_2.png) [@hussamkhatib](https://community.auth0.com/u/hussamkhatib)\
**Post date:** [October 16, 2021, 11:42am UTC](https://community.auth0.com/t/checks-state-argument-is-missing-in-next-js/70639/5 "2021-10-16T11:42:06Z")

</div>

The issue is resolved now.  
I had set the env variables on both local and vercel as exactly same.  
So in production It gave error because the login/logout logout was at localhost://3000

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 31, 2021, 11:42am UTC](https://community.auth0.com/t/checks-state-argument-is-missing-in-next-js/70639/6 "2021-10-31T11:42:20Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
