From bd68461e5d3283261d5e86bb99d8ca46bb158194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Thu, 19 Dec 2024 15:28:40 +0100 Subject: [PATCH] ensure cancel error is triggered if exit and oauth not processed --- packages/oauth/oauth_cordova.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/oauth/oauth_cordova.js b/packages/oauth/oauth_cordova.js index 87da00af5f..b71e13d133 100644 --- a/packages/oauth/oauth_cordova.js +++ b/packages/oauth/oauth_cordova.js @@ -64,6 +64,12 @@ OAuth.showPopup = (url, callback, dimensions) => { }; const onExit = () => { + // Force callback to throw cancel error when exit + // and oauth process didn't start + if (!oauthFinished) { + callback(); + } + popup.removeEventListener('loadstop', pageLoaded); popup.removeEventListener('loaderror', fail); popup.removeEventListener('exit', onExit);