From 22723f256c1a8687fdb3d5fec3ed444be6f75c00 Mon Sep 17 00:00:00 2001 From: Adam Cassis Date: Thu, 16 May 2024 15:27:33 +0200 Subject: [PATCH] fix(oauth): prevent false warning when opening Google OAuth --- assets/reader-activation/auth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/reader-activation/auth.js b/assets/reader-activation/auth.js index dbd3dc461b..52f8d29e7a 100644 --- a/assets/reader-activation/auth.js +++ b/assets/reader-activation/auth.js @@ -631,12 +631,12 @@ window.newspackRAS.push( function ( readerActivation ) { } else if ( authWindow ) { authWindow.location = data; const interval = setInterval( () => { - if ( ! googleOAuthSuccess ) { + if ( ! googleOAuthSuccess && authWindow.closed ) { if ( googleLoginForm?.endLoginFlow ) { googleLoginForm.endLoginFlow( newspack_reader_auth_labels.login_canceled, 401 ); } + clearInterval( interval ); } - clearInterval( interval ); }, 500 ); } else if ( googleLoginForm?.endLoginFlow ) { googleLoginForm.endLoginFlow( newspack_reader_auth_labels.blocked_popup );