-
Notifications
You must be signed in to change notification settings - Fork 261
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
fix(clerk-js): Use the correct returnBack url when GoogleOneTap remains open across navigations #3410
Conversation
🦋 Changeset detectedLatest commit: c38d85c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ns open across navigations
60ad709
to
5b849ae
Compare
}, | ||
navigate, | ||
); | ||
await clerk.handleGoogleOneTapCallback(res, ctx.generateCallbackUrls(window.location.href), navigate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❗️I couldn't find a robust way to listen to url changes (history) so i went with the synchronous solution to pass the current url when the callback runs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do something like:
window.history.pushState = new Proxy(window.history.pushState, {
apply: (target, thisArg, argArray) => {
// trigger here what you need
return target.apply(thisArg, argArray);
},
});
and make a useCurrentLocation
hook or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but let's try to do it with a proxy on pushState
and see if that simplifies things?!
We will attempt to find another solution in another PR |
Description
Bug fix: Use the correct returnBack url when GoogleOneTap remains open across navigations.
Previously it will only use the url that existed in the browser url bar at the time the component was initially rendered.
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change