P粉6161110382023-08-26 18:51:46
Yes, this may have something to do with the COOP configuration of your pages, login pages, and how they interact. When two pages do not have the same COOP, they end up in separate browsing context groups, which may prevent certain interactions, such as the window.close method.
It's hard to give an exact solution without seeing your code and implementation, but you can try modifying your COOP so that it matches the COOP of the login page.
This can be same-origin
or same-origin-allow-popups
.
These headers can be set in the NextJS configuration: https ://nextjs.org/docs/pages/api-reference/next-config-js/headers
In your case:
module.exports = { async headers() { return [ { source: "/(.*)", headers: [ { key: "Cross-Origin-Opener-Policy", value: "same-origin", // "same-origin-allow-popups" }, ], }, ]; }, };
P粉6163836252023-08-26 13:48:14
This seems to be a problem that has not been solved for a long time. However, please try the following
You can also refer to the Cross-Origin Isolation Guide- https://web.dev /cross-origin-isolation-guide/ and MDN Documentation to learn more about Cross-Origin- More information on Opener-Policy
If you are using the Google API, make sure to also add the URI with the port, such as localhost:3000
. You can check out my live website - https://radheshyamdas.com/ I am using firebase auth .js built with Next