Fix signup page silent bug for sign-up-without-prompt-items case.

This commit is contained in:
Yang Luo
2021-08-01 00:16:13 +08:00
parent bc5e748e5c
commit e39c3b7613
2 changed files with 15 additions and 15 deletions

View File

@ -128,10 +128,8 @@ class LoginPage extends React.Component {
Setting.goToLinkSoft(ths, `/prompt/${application.name}?redirectUri=${oAuthParams.redirectUri}&code=${code}&state=${oAuthParams.state}`); Setting.goToLinkSoft(ths, `/prompt/${application.name}?redirectUri=${oAuthParams.redirectUri}&code=${code}&state=${oAuthParams.state}`);
} }
} else { } else {
if (res.msg !== "Please sign in first") {
Setting.showMessage("error", `Failed to sign in: ${res.msg}`); Setting.showMessage("error", `Failed to sign in: ${res.msg}`);
} }
}
}); });
} else { } else {
Setting.goToLink(`${oAuthParams.redirectUri}?code=${code}&state=${oAuthParams.state}`); Setting.goToLink(`${oAuthParams.redirectUri}?code=${code}&state=${oAuthParams.state}`);

View File

@ -127,6 +127,7 @@ class SignupPage extends React.Component {
AuthBackend.signup(values) AuthBackend.signup(values)
.then((res) => { .then((res) => {
if (res.status === 'ok') { if (res.status === 'ok') {
if (Setting.hasPromptPage(application)) {
AuthBackend.getAccount("") AuthBackend.getAccount("")
.then((res) => { .then((res) => {
let account = null; let account = null;
@ -137,11 +138,12 @@ class SignupPage extends React.Component {
this.onUpdateAccount(account); this.onUpdateAccount(account);
Setting.goToLinkSoft(this, this.getResultPath(application)); Setting.goToLinkSoft(this, this.getResultPath(application));
} else { } else {
if (res.msg !== "Please sign in first") {
Setting.showMessage("error", `Failed to sign in: ${res.msg}`); Setting.showMessage("error", `Failed to sign in: ${res.msg}`);
} }
}
}); });
} else {
Setting.goToLinkSoft(this, this.getResultPath(application));
}
} else { } else {
Setting.showMessage("error", i18next.t(`signup:${res.msg}`)); Setting.showMessage("error", i18next.t(`signup:${res.msg}`));
} }