From 4330f7e7bf4db72962797085b2a8f202cadec5c7 Mon Sep 17 00:00:00 2001 From: Oliwia Rogala Date: Mon, 19 May 2025 14:43:51 +0200 Subject: [PATCH 1/2] fix: avoid processing undefined authorizationUrl --- src/core/oauth2-authorize.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/oauth2-authorize.js b/src/core/oauth2-authorize.js index eac1339b6e8..f9f7209dd27 100644 --- a/src/core/oauth2-authorize.js +++ b/src/core/oauth2-authorize.js @@ -109,7 +109,11 @@ export default function authorize ( { auth, authActions, errActions, configs, au } else { sanitizedAuthorizationUrl = sanitizeUrl(authorizationUrl) } - let url = [sanitizedAuthorizationUrl, query.join("&")].join(authorizationUrl.indexOf("?") === -1 ? "?" : "&") + let url = [sanitizedAuthorizationUrl, query.join("&")].join( + typeof authorizationUrl === "string" && authorizationUrl.indexOf("?") === -1 + ? "?" + : "&" + ) // pass action authorizeOauth2 and authentication data through window // to authorize with oauth2 From 358d081d306ca37b261980fb52a03025841e6b34 Mon Sep 17 00:00:00 2001 From: Oliwia Rogala Date: Tue, 20 May 2025 11:19:33 +0200 Subject: [PATCH 2/2] fix: apply code review changes --- src/core/oauth2-authorize.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/oauth2-authorize.js b/src/core/oauth2-authorize.js index f9f7209dd27..e20cdd3b594 100644 --- a/src/core/oauth2-authorize.js +++ b/src/core/oauth2-authorize.js @@ -110,7 +110,7 @@ export default function authorize ( { auth, authActions, errActions, configs, au sanitizedAuthorizationUrl = sanitizeUrl(authorizationUrl) } let url = [sanitizedAuthorizationUrl, query.join("&")].join( - typeof authorizationUrl === "string" && authorizationUrl.indexOf("?") === -1 + typeof authorizationUrl === "string" && !authorizationUrl.includes("?") ? "?" : "&" )