diff --git a/src/core/oauth2-authorize.js b/src/core/oauth2-authorize.js index eac1339b6e8..e20cdd3b594 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.includes("?") + ? "?" + : "&" + ) // pass action authorizeOauth2 and authentication data through window // to authorize with oauth2