fix: oAuthParams may not exist (#594)

Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com>
This commit is contained in:
Yixiang Zhao
2022-03-20 10:33:50 +08:00
committed by GitHub
parent 0841eb5c30
commit 6bc4e646e5
2 changed files with 2 additions and 2 deletions

View File

@ -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') {

View File

@ -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("")