Cross-Origin-Opener-Policy policy would block the window.closed call error while using google auth #51135
Replies: 51 comments 61 replies
-
Have this same problem too. Thanks for opening mr-chandan. |
Beta Was this translation helpful? Give feedback.
-
Haven't found a solution yet. If I do, I will be sure to post.
…On Mon, Jun 12, 2023 at 7:52 AM Chandan H ***@***.***> wrote:
Did you find any solutions ? Do share it
—
Reply to this email directly, view it on GitHub
<#51135 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYRHNHFAMC5EZZABVQJU2DXK4UMXANCNFSM6AAAAAAZCOVSVI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
stuck in same prob :( |
Beta Was this translation helpful? Give feedback.
-
I got this while running it locally, is this your case as well? |
Beta Was this translation helpful? Give feedback.
-
I have also encountered this issue, followed by another one, also appearing twice:
From what I was able to debug, it originates from the pop-up's iframe,
Apparently the iframe is trying to make contact with the parent window for some reason I was unable to determine. In my case, errors are beeing thrown exactly after the execution of this line, with a.i set to true. Only suggested solutions i have come across suggested adding appropriate headers on my side, but including them in my nginx server configuration didn't help at all. I don't quite understand how would it be possibble for the OAuth iframe to communicate with its parent window while it most likely implements server-wide "same-origin" header for COOP (at least with all the other requests I was able to notice). |
Beta Was this translation helpful? Give feedback.
-
Same issue... Please help @ijjk @tianenpang @Timer @huozhi @shibe23 |
Beta Was this translation helpful? Give feedback.
-
Did anyone found the solution?? |
Beta Was this translation helpful? Give feedback.
-
@everyone on the thread I've solved inspect your code flow once and if you still face any issues, I'll be happy to help |
Beta Was this translation helpful? Give feedback.
-
Having the same issue and after some searches this code works for me. Write the code in next.config.js. Also, if I am opening the dev server on opera, I am not getting any errors. but still getting another error. |
Beta Was this translation helpful? Give feedback.
-
Also problem... here :/ |
Beta Was this translation helpful? Give feedback.
-
Yes I get the errors yet it is not blocking the sign up flow. Before the
errors were blocking the flow. Yet still want to find a fix.
…On Wed, Jun 14, 2023 at 9:33 PM Abhishek Das ***@***.***> wrote:
@osaidfaisal12 <https://github.com/osaidfaisal12> u r still getting that
error?
—
Reply to this email directly, view it on GitHub
<#51135 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYRHNCCEZ4JPAWJ7NDMETLXLKGBHANCNFSM6AAAAAAZCOVSVI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
hi, |
Beta Was this translation helpful? Give feedback.
-
i has that issue too. anyone know the solution? |
Beta Was this translation helpful? Give feedback.
-
Just started happening to me using JavaScript, my solution was to remove the popup flow and worked like a charm:
also in Firebase ui documentation. |
Beta Was this translation helpful? Give feedback.
-
I have tried all the methods seriously. I tried Google Identity Service with popups and without popups (redirect). I used different npm packages that support Google Sign-In and also used Firebase Authentication. Nothing works. 😢 I thought the popup sign-in window resulted in an error and even tried redirecting to the URL, but still, it says CORS error. While redirecting, it says that the frontend URL can't connect to the backend URL due to a CORS error. To use any other button, say even contact us in the footer, I can't send any request. For that, I need to refresh the page again. Also, the interesting thing is that in my localhost:3000, there is no problem with either of the methods, though I don't use any CORS extension, proxy, etc. to bypass CORS error. I only face this error once I host the application (Render and Vercel). Do you guys think that somewhere or the other hosting on Vercel is creating a problem? I haven't tried hosting on another platform. I have found a temporary solution, using Auth0 authentication for the time being, as they allow 7000 free registered users (no credit card is required for registration). Though the demerit is that you can't use any other authentication apart from Google Sign-in unless you pay for their service or keep creating a new account every 14 days 😂 One more demerit is that you won't be able to record the phone number of the user if you are using MFA via Twilio. If someone has overcome the error, do share the solution for this. |
Beta Was this translation helpful? Give feedback.
-
I solve this adding this in the next.config.js file. module.exports = { |
Beta Was this translation helpful? Give feedback.
-
i had the same problem with a project with next.js 12 and the firebase signInWithPopup. it's ugly, but it worked .... |
Beta Was this translation helpful? Give feedback.
-
Read the whole page but still stuck on this. Error: Cross-Origin-Opener-Policy policy would block the window.close call. |
Beta Was this translation helpful? Give feedback.
-
i think i find solution. |
Beta Was this translation helpful? Give feedback.
-
I added origin without port to fix this issue. Add both http://localhost and http://localhost:<port_number> to the Authorized JavaScript origins box for local tests or development. |
Beta Was this translation helpful? Give feedback.
-
Hey @mr-chandan, I just figured out that I had disabled third-party cookies. After enabling them, everything finally worked for me. Before disable 3th-party cookies:After enable 3th-party cookies:Here's my Google Client ID configuration: You guys can try out my live demo. And here is my google-one-tap.tsx file:
Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Has anyone solved this issue for msal login flow? |
Beta Was this translation helpful? Give feedback.
-
As a half measure you can replace your |
Beta Was this translation helpful? Give feedback.
-
Thank you. |
Beta Was this translation helpful? Give feedback.
-
This worked for me https://stackoverflow.com/a/77297872/15132274. Using nextjs and Firebase |
Beta Was this translation helpful? Give feedback.
-
Guy's try to lookup for the URL. In my case i trying to call a different url. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
const provider = new GoogleAuthProvider(); // Use 'GoogleAuthProvider' directly |
Beta Was this translation helpful? Give feedback.
-
I tried all of the above mentioned solutions one by one and also combining them also doesn't work. for context I am using Angular 17 and the authentication signinWithPopup and for firebase i am using @angular/fire packages |
Beta Was this translation helpful? Give feedback.
-
Summary
I am using next, firebase and its google auth tool, everything works fine the user data is getting saved in the database but i get a error every time the popup window appears (Cross-Origin-Opener-Policy policy would block the window.closed call)
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions