From 6bc4e646e5e5618de2ca726fdc841c1f94fd0edb Mon Sep 17 00:00:00 2001 From: Yixiang Zhao Date: Sun, 20 Mar 2022 10:33:50 +0800 Subject: [PATCH] fix: oAuthParams may not exist (#594) Signed-off-by: Yixiang Zhao --- web/src/auth/AuthCallback.js | 2 +- web/src/auth/LoginPage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/auth/AuthCallback.js b/web/src/auth/AuthCallback.js index 9fcb72752..06e4e9811 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?.indexOf('?') === -1 ? '?' : '&'; 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 0333b8327..cf9a9eabc 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?.indexOf('?') === -1 ? '?' : '&'; if (Setting.hasPromptPage(application)) { AuthBackend.getAccount("")