Skip to content

Commit 119052e

Browse files
authored
fix(oauth2): avoid processing authorizationUrl when it is not a string (#10452)
1 parent 6a07ac8 commit 119052e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/oauth2-authorize.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ export default function authorize ( { auth, authActions, errActions, configs, au
109109
} else {
110110
sanitizedAuthorizationUrl = sanitizeUrl(authorizationUrl)
111111
}
112-
let url = [sanitizedAuthorizationUrl, query.join("&")].join(authorizationUrl.indexOf("?") === -1 ? "?" : "&")
112+
let url = [sanitizedAuthorizationUrl, query.join("&")].join(
113+
typeof authorizationUrl === "string" && !authorizationUrl.includes("?")
114+
? "?"
115+
: "&"
116+
)
113117

114118
// pass action authorizeOauth2 and authentication data through window
115119
// to authorize with oauth2

0 commit comments

Comments
 (0)