-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite redirect loop on same-domain deployments #2595
Comments
Dear team, according to the discussions on Discord a lot of people have this problem of infinite loading loops. Is there any progress on that or a mitigation strategy besides working in incognito mode or clearing all cookies beforehand? |
Hi @stx-chris, Unfortunately Clerk does not support using more than one instance on a single TLD at this time. There are a few things that can cause infinite redirects, but when we confirm a Discord user or anyone submitting a support request is using two or more instances on one domain we reiterate this limitation. Some options
Please let me know if you have any questions. |
Hi @royanger, thx for following up on this. I understand and we'll try to move the dev-environment to another domain. Please note, however, that a setup dev/test/staging/prod on the same domain is a very common pattern and other companies are facing the same issue and might not switch to other domains because one element of the toolchain cannot cope with it. May I ask you to prioritize this issue and discuss with the team potential solutions to make it work? Thank you! |
Hey, as my colleague said it's currently not supported but we do track the request here: https://feedback.clerk.com/roadmap/b4c407a7-4514-4ff6-85f7-39a8a645397b It's on our radar and we intent to fix it, but for now please resort to the workarounds that were given. |
Preliminary Checks
Reproduction / Replay Link
N/A
Publishable key
pk_test_ZW5hYmxpbmctb3NwcmV5LTUxLmNsZXJrLmFjY291bnRzLmRldiQ
Description
This is a re-post of my comments in #1436, as I think this issue has a specific reason:
We are experiencing infinite redirects since the release of our production environment. The issue might be tied to the \\\__client_uat cookie which is available twice if both the develop and the main instance are running on the same domain.
We have the following scenario:
development on a.b.c.mysite.io
main on app.mysite.io
This is the cookie we see on main:
\\\__client_uat =
This is what we see on develop:
First cookie, domain "a.b.c.mysite.io": \\\__client_uat =
Second cookie, domain ".mysite.io": \\\__client_uat = 0
Once one has visited the main site with their browser and switches to develop to test something, the site is trapped in an infinite loop with the error referring to the said cookie, ie.
The Cookie '\\\__client_uat' has been rejected for invalid domain.
We have to painfull clear the cookies, refresh everything and refrain from accessing the live site in the same session. It never occurs on localhost. Anybody else having this issue?
(Node v18.17.0, @clerk/nextjs v4.29.3, in Docker)
Environment
The text was updated successfully, but these errors were encountered: