Auth0 Login works with the app from the Auth0 Next.js QuickStart when using localhost, but attempting to use a custom domain by configuring the hosts file does not.
Update the hosts file on windows with a custom domain to point to the IP of Windows Subystem for Linux
Reconfigure the app to use a custom domain
Relaunch the app and attempt to test the login functionality - this might require clearing the browser history/cache. The user will get redirected to the login page, but the login process fails on the callback url with an http status code 302.
The only error that happens is before the login process even happens
Error: Route “/api/auth/[auth0]” used params.auth0. params should be awaited before using its properties. Learn more: Dynamic APIs are Asynchronous | Next.js
Could you check your Auth0 Logs to determine the behavior you are experiencing? Then, please share your findings with me here.
Secondly, if the login flow fails on the callback URL, there might be issues around the URL itself. Is this callback URL the same one you used during your localhost login attempts?
The logs show two entries ‘Success Login’ and and ‘Success Exchange of Authorization Code’ and I should have also stated the browser lands on an NGinx 502 Bad Gateway on the callback.
The callback URL uses the domain and not localhost.
I tried creating a new project with Next.js 14.2.17 just in case it was because of the recent breaking changes, but still get the same error.
Ok, I didn’t believe it was nginx, but seems to be this error. Found some nginx settings online to configure buffer sizes, etc. Gotta find one that doesn’t throw errors I think.
upstream sent too big header while reading response header from upstream
No combination of increasing the header size has worked; so I just deleted everything in the user’s app_metadata and was able to login. So, some secret combo of settings will get stuff working again.
Thank you for checking, but I have verified the issue is I did not properly configure nginx to handle the large header size resulting from the user’s app_metadata.