Skip to content
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

Clerk Multi Domain Not Working - Satellite Domain #1837

Open
najamrankbee opened this issue Dec 26, 2024 · 0 comments
Open

Clerk Multi Domain Not Working - Satellite Domain #1837

najamrankbee opened this issue Dec 26, 2024 · 0 comments

Comments

@najamrankbee
Copy link

.env
NEXT_PUBLIC_CLERK_DOMAIN=http://localhost:3000
NEXT_PUBLIC_CLERK_SIGN_IN_URL=http://localhost:3002/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=http://localhost:3002/sign-up

Error in console:
Clerk: Refreshing the session token resulted in an infinite redirect loop. This usually means that your Clerk instance keys do not match - make sure to copy the correct publishable and secret keys from the Clerk dashboard.

Behaviour:
When I open satellite domain (localhost:3000), it redirects me to primary domain sign-in page which is fine but once I login on my primary domain it keep looping there

Middleware.tsx:
const { userId, redirectToSignIn } = await auth()

if (!userId && isPrivateRoute(req)) {
return redirectToSignIn()
}

Packages:
"next": "14.2.20",
"@clerk/nextjs": "^6.9.6",
"react": "^18.3.1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant