The callback handler detects whether a login was triggered as the result of an OAuth2 redirect and handles it accordingly by sending the authorization code to the parent window. No-op on normal logins.
Explicitly check the return value of handleCallback to prevent triggering the OpenID login logic. Signed-off-by: Arthur Bied-Charreton <[email protected]> --- www/Application.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/Application.js b/www/Application.js index e82ccdd0d..fa5d40372 100644 --- a/www/Application.js +++ b/www/Application.js @@ -57,10 +57,12 @@ Ext.define('PBS.Application', { var provider = new Ext.state.LocalStorageProvider({ prefix: 'ext-pbs-' }); Ext.state.Manager.setProvider(provider); + let isOAuth2Callback = Proxmox.OAuth2.handleCallback(new URLSearchParams(window.location.search)); + let isOpenIDLogin = Proxmox.Utils.getOpenIDRedirectionAuthorization() !== undefined; let alreadyLoggedIn = Proxmox.Utils.authOK(); - if (isOpenIDLogin || !alreadyLoggedIn) { + if (!isOAuth2Callback && (isOpenIDLogin || !alreadyLoggedIn)) { me.changeView('loginview', true); // show login window if not loggedin } else { me.changeView('mainview', true); -- 2.47.3
