Fix getStateFromQueryParams() crash when provider name is non-latin

This commit is contained in:
Yang Luo 2023-05-01 10:32:08 +08:00
parent b1589e11eb
commit 8d531b8880

View File

@ -117,7 +117,7 @@ export function getOAuthGetParameters(params) {
export function getStateFromQueryParams(applicationName, providerName, method, isShortState) { export function getStateFromQueryParams(applicationName, providerName, method, isShortState) {
let query = window.location.search; let query = window.location.search;
query = `${query}&application=${applicationName}&provider=${providerName}&method=${method}`; query = `${query}&application=${encodeURIComponent(applicationName)}&provider=${encodeURIComponent(providerName)}&method=${method}`;
if (method === "link") { if (method === "link") {
query = `${query}&from=${window.location.pathname}`; query = `${query}&from=${window.location.pathname}`;
} }