# \[NextJS\] LoginHandlerError: Login handler failed. CAUSE: Discovery requests failing for {domain}, expected 200 OK, got: 404 Not Found

**URL:** <https://community.auth0.com/t/nextjs-loginhandlererror-login-handler-failed-cause-discovery-requests-failing-for-domain-expected-200-ok-got-404-not-found/141924>\
**Category:** Get Help\
**Tags:** sdks-quickstarts, nextjs-auth0\
**Created:** [August 27, 2024, 4:28pm UTC](https://community.auth0.com/t/nextjs-loginhandlererror-login-handler-failed-cause-discovery-requests-failing-for-domain-expected-200-ok-got-404-not-found/141924 "2024-08-27T16:28:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hearhere](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@hearhere](https://community.auth0.com/u/hearhere)\
**Post date:** [August 27, 2024, 4:42pm UTC](https://community.auth0.com/t/nextjs-loginhandlererror-login-handler-failed-cause-discovery-requests-failing-for-domain-expected-200-ok-got-404-not-found/141924/2 "2024-08-27T16:42:16Z")

</div>

I’ll reply in case anyone else finds it. It was indeed a bad environment variable in my .env.local as others have run into. In my case, the .us. piece of my domain was missing somehow.

Once I got the correct value in, I was able to log in.

---

_[View the full topic](https://community.auth0.com/t/nextjs-loginhandlererror-login-handler-failed-cause-discovery-requests-failing-for-domain-expected-200-ok-got-404-not-found/141924)._
