-
Notifications
You must be signed in to change notification settings - Fork 402
Description
Checklist
- The issue can be reproduced in the auth0-spa-js sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the documentation and API documentation, and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
we are using auth0 to incrementally consent google API, after login. So when click a button, we try to call Loginwithpop to finish consent. but after the consent finished, in the console log show the error messages below:
Cross-Origin-Opener-Policy policy would block the window.closed call.
Reproduction
Sample app can repro this bug; by change loginWithRedirect to loginWithPopup
Below are some code snippet from my project
public async incrementalConsentGoogle(): Promise {
const { auth0 } = await Auth0.get();
const user = await auth0.getUser();
return auth0.loginWithPopup({
authorizationParams: {
...AUTH0_GOOGLE_CALENDAR_REQUEST.authorizationParams,
login_hint: user?.email,
connection: this.getConnectionFromTokenType("google"),
},
});
}
await incrementalConsentGoogle(getConsentPopup())
.then(async () => {
setAllowAccess(isChecked);
})
.catch(async (error: Error) => {
});
catch can't catch the error: Cross-Origin-Opener-Policy policy would block the window.closed call.
Additional context
I find some posts with the same issue with me, that both not been addressed.
https://community.auth0.com/t/cross-origin-opener-policy-policy-would-block-the-window-closed-call/129059
https://community.auth0.com/t/winchan-js-150-cross-origin-opener-policy-policy-would-block-the-window-closed-call/110030
auth0-spa-js version
@auth0/[email protected]
Which framework are you using (React, Angular, Vue...)?
React
Framework version
Which browsers have you tested in?
Chrome