# Got error 500 when trying to login

**URL:** <https://community.auth0.com/t/got-error-500-when-trying-to-login/66186>\
**Category:** Get Help\
**Created:** [July 15, 2021, 1:01am UTC](https://community.auth0.com/t/got-error-500-when-trying-to-login/66186 "2021-07-15T01:01:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AhmedKenani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ahmedkenani/32/30532_2.png) [@AhmedKenani](https://community.auth0.com/u/AhmedKenani)\
**Post date:** [July 15, 2021, 1:01am UTC](https://community.auth0.com/t/got-error-500-when-trying-to-login/66186/1 "2021-07-15T01:01:07Z")

</div>

i am a beginner learnt auth0 just recently and this is my first time doing an app with it  
anyway the problem is, i deployed my next js app which uses auth0 but i got " error 500 " when try to reach “api/auth/login” it works on localhost but not on deployment

thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 15, 2021, 4:43pm UTC](https://community.auth0.com/t/got-error-500-when-trying-to-login/66186/3 "2021-07-15T16:43:16Z")

</div>

It’s hard to know exactly why this is happening without a bit more information.

Are you getting the error when you are trying to reach one of your endpoints? That would suggest something is wrong on your web server.

---

<div class="post-metadata">

**Author:** ![AhmedKenani](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ahmedkenani/32/30532_2.png) [@AhmedKenani](https://community.auth0.com/u/AhmedKenani)\
**Post date:** [July 16, 2021, 2:21am UTC](https://community.auth0.com/t/got-error-500-when-trying-to-login/66186/4 "2021-07-16T02:21:56Z")

</div>

Just solved it, i forgot .env.production file i put it and redeployed the app and it works just fine

Thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 20, 2021, 10:05pm UTC](https://community.auth0.com/t/got-error-500-when-trying-to-login/66186/5 "2021-07-20T22:05:35Z")

</div>

Thanks for providing an update!

---

<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:** [August 4, 2021, 10:05pm UTC](https://community.auth0.com/t/got-error-500-when-trying-to-login/66186/6 "2021-08-04T22:05:42Z")

</div>

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