Hi All, I am creating OwnUI with Auth0.js and getting below error on webAuth.popup.authorize(
winchan.js:150 Cross-Origin-Opener-Policy policy would block the window.closed call.
winchan.js:195 Cross-Origin-Opener-Policy policy would block the window.postMessage call.
I am sorry regarding the late reply to your inquiry.
If you still have issues with this problem, do not hesitate to leave a reply or post again on the community page.
As far as I have researched the error that you are receiving, it appears to be an error thrown by the firebaseui npm package. Currently, there does not appear to be a definitive fix to the issue at hand, however I was able to identify some possible workarounds or causes which trigger the respective error:
The easiest way to check that your code is working without the error is to switch temporarily from signInFlow="popup" to signInFlow="redirect" , which is the default value in Firebase UI Auth.
Since you are experiencing issues with google authentication in your implementation, you can attempt using same-origin-allow-popups header instead of same origin for Cross-Origin-Opener-Policy on pages where you use google sign in button.
If you are using any kind of API in your implementation, please double check the scopes since that might trigger the error.
If you are using NextJS, you can attempt to add the following code inside the next.config.js:
You can attempt to remove the COOP/COEP headers that you have added in your application as per this github post related to the same issue that you are experiencing.
In conclusion, the COOP errors appears to be triggered by the browser’s policies, the error may vary from browser to browser and a definitive fix may vary depending on your application/implementation.
If you have any additional questions regarding the matter, feel free to leave a reply or post again on the community page!