# Auth0 Issues: ERR\_LOGIN\_HANDLER\_FAILURE

**URL:** <https://community.auth0.com/t/auth0-issues-err-login-handler-failure/142585>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [September 2, 2024, 6:27pm UTC](https://community.auth0.com/t/auth0-issues-err-login-handler-failure/142585 "2024-09-02T18:27:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yusra](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@yusra](https://community.auth0.com/u/yusra)\
**Post date:** [September 2, 2024, 6:27pm UTC](https://community.auth0.com/t/auth0-issues-err-login-handler-failure/142585/1 "2024-09-02T18:27:22Z")

</div>

I’ve integrated Auth0 into my NextJS app.

Everything was working fine until I changed my env to production and deployed my app. Now Auth0 works fine on the deployed app URL but it gives this ERR\_LOGIN\_HANDLER\_FAILURE error on local environment.

Now the main issue is that this error is totally RANDOM! Sometimes i keep getting it after refreshing and restarting my app but sometimes everything works smoothly so it’s really hard to reproduce when for testing. Also It’s pretty hard to track and debug it.

ANY HELP WOULD BE APPRECIATED as this really affects my work!

---

<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:** [September 4, 2024, 8:14pm UTC](https://community.auth0.com/t/auth0-issues-err-login-handler-failure/142585/3 "2024-09-04T20:14:34Z")

</div>

Hi @yusra,

Welcome to the Auth0 Community!

The login handler error occurs when a bad environment variable is present in your `.env.local` file. I recommend ensuring the environment variables in your `.env.local` file have the correct values.

This error has a solution mentioned in [this related community 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/2).

Let me know if you have any questions.

Cheers,  
Rueben

---

<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:** [September 18, 2024, 8:14pm UTC](https://community.auth0.com/t/auth0-issues-err-login-handler-failure/142585/4 "2024-09-18T20:14:56Z")

</div>

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