# loginWithPopup: Cross-Origin-Opener-Policy policy would block the window.closed call

**URL:** <https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [September 15, 2025, 8:51am UTC](https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909 "2025-09-15T08:51:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![msgraceguan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msgraceguan/32/75206_2.png) [@msgraceguan](https://community.auth0.com/u/msgraceguan)\
**Post date:** [September 15, 2025, 8:51am UTC](https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909/1 "2025-09-15T08:51:22Z")

</div>

Auth0 version: @auth0/auth0-spa-js@2.1.3  
React version: react@18.3.1  
browser tested in : chrome and edge

loginWithRedirect({

authorizationParams: {

audience: config.audience,

scope: “openid profile email offline\_access”,

redirect\_uri: “callback”,

access\_type: “offline”,

include\_granted\_scopes: “true”,

connection\_scope: “google calendar consent”,

connection: “google-oauth2”,

},

});

await incrementalConsentGoogle(getConsentPopup())  
.then(async () =\> {  
setAllowAccess(isChecked);  
})  
.catch(async (error: Error) =\> {  
});

the error keeps showing every login.

inportantly, this error can been see when run Auth0 sample App by change LoginWithRedirect to LoginWithPopup

---

<div class="post-metadata">

**Author:** ![msgraceguan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msgraceguan/32/75206_2.png) [@msgraceguan](https://community.auth0.com/u/msgraceguan)\
**Post date:** [September 15, 2025, 8:58am UTC](https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909/2 "2025-09-15T08:58:50Z")

</div>

When I run the sample-01 in you website, just change loginWithRedirect to loginWithPopup and check the console, the error message is there.

---

<div class="post-metadata">

**Author:** ![msgraceguan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/msgraceguan/32/75206_2.png) [@msgraceguan](https://community.auth0.com/u/msgraceguan)\
**Post date:** [September 15, 2025, 9:02am UTC](https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909/3 "2025-09-15T09:02:49Z")

</div>

and the error can’t been catched within try…catch

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [September 16, 2025, 3:36pm UTC](https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909/5 "2025-09-16T15:36:42Z")

</div>

Hi @msgraceguan

Welcome to the Auth0 Community!

Could you let me know if the proposed solution by me in this [related community post](https://community.auth0.com/t/winchan-js-150-cross-origin-opener-policy-policy-would-block-the-window-closed-call/110030/2) is able to fix your issue?

Otherwise, can you also try these following steps regarding troubleshooting the issue:

1. On the login page, register an event listener for local storage. We will be listening for a change to an `isLoggedIn` flag set in the popup window.
2. When the user clicks “login” open a popup window on a route that immediately triggers the Auth0 redirect.
3. The user is redirected to Auth0 and logs in.
4. Auth0 then redirects back to my site, we check for success, and set the `isLoggedIn` flag to a truthy value.
5. The popup window can now close itself.
6. Back in the main window, the local storage event listener is triggered, and we can use the Auth0 method `getAccessTokenSilently` to refresh the auth state.

If you still experience issues or have any other questions, let me know!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [December 9, 2025, 3:50pm UTC](https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909/6 "2025-12-09T15:50:01Z")

</div>

Hi @msgraceguan

Since I haven’t heard back from you for a while, I will be marking my previous reply as a solution. You can remove the solution before the topic closes automatically if you still experience issues or you can always post again and reference this post.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 23, 2025, 3:50pm UTC](https://community.auth0.com/t/loginwithpopup-cross-origin-opener-policy-policy-would-block-the-window-closed-call/191909/7 "2025-12-23T15:50:25Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
