-
Notifications
You must be signed in to change notification settings - Fork 345
Infinite Redirect Loop When Home URL is current URL #2581
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
Comments
I'm facing the same issue currently, any fix? |
Same issue! |
Hello @jeremysawesome By default the To fix this in vanilla JS you can simply check if the user exists and avoid mounting the component. <script>
async function clerkLoad() {
await Clerk.load()
if(Clerk.user) return ; // This line is needed
const signInContainer = document.getElementById("SignIn")
Clerk.mountSignIn(signInContainer)
}
</script> |
I'm closing due to inactivity, if the snippet above does not solve the issue, feel free to reopen |
Hi @panteliselef I still think that, rather than redirecting, the component should just not be rendered. As it is the warnings that are output in the console cannot be read unless one can expertly stop the redirect loop. That said, I think that #2251, when it is released, will resolve some of the confusion. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Uh oh!
There was an error while loading. Please reload this page.
Preliminary Checks
Reproduction / Replay Link
https://gitlab.com/jeremysawesome/clerk-minimal-reproduction
Publishable key
pk_test_dG9nZXRoZXItZWdyZXQtMzUuY2xlcmsuYWNjb3VudHMuZGV2JA
Description
If the Home URL and the current url are the same, and there is a SignIn or SignUp component mounted on the page, then Clerk will infinitely redirect.
Here's a gif to illustrate
Steps to reproduce:
(i.e.
$DEVHOST/clerk-minimal-reproduction/
)./clerk-minimal-reproduction/
$DEVHOST/clerk-minimal-reproduction/
in your browser.Behold the redirect loop.
Expected behavior:
Actual behavior:
Clerk initiates an infinite redirect loop. It's hard to find the reason why unless you are able to pause the page after the Clerk message appears in the console but before the page reloads.
Environment
The text was updated successfully, but these errors were encountered: