diff --git a/web/src/auth/AuthCallback.js b/web/src/auth/AuthCallback.js index 06e4e9811..2359c3afb 100644 --- a/web/src/auth/AuthCallback.js +++ b/web/src/auth/AuthCallback.js @@ -106,7 +106,7 @@ class AuthCallback extends React.Component { method: method, }; const oAuthParams = Util.getOAuthGetParameters(innerParams); - const concatChar = oAuthParams?.redirectUri?.indexOf('?') === -1 ? '?' : '&'; + const concatChar = oAuthParams?.redirectUri?.includes('?') ? '&' : '?'; AuthBackend.login(body, oAuthParams) .then((res) => { if (res.status === 'ok') { diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index cf9a9eabc..2f914041f 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -138,7 +138,7 @@ class LoginPage extends React.Component { Setting.goToLink(link); } else if (responseType === "code") { const code = res.data; - const concatChar = oAuthParams?.redirectUri?.indexOf('?') === -1 ? '?' : '&'; + const concatChar = oAuthParams?.redirectUri?.includes('?') ? '&' : '?'; if (Setting.hasPromptPage(application)) { AuthBackend.getAccount("")