Skip to content

Instantly share code, notes, and snippets.

@dinkydani
Last active January 19, 2022 20:27
Show Gist options
  • Save dinkydani/64cefb99bb365139028e968ab67c3899 to your computer and use it in GitHub Desktop.
Save dinkydani/64cefb99bb365139028e968ab67c3899 to your computer and use it in GitHub Desktop.
export default () => {
useEffect(() => {
// get the URL parameters which will include the auth token
const params = window.location.search;
if (window.opener) {
// send them to the opening window
window.opener.postMessage(params);
// close the popup
window.close();
}
});
// some text to show the user
return <p>Please wait...</p>;
};
@joziahg
Copy link

joziahg commented Jan 19, 2022

window.opener is null when using google oauth passport provider. Redirection in popup maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment