Skip to content

Commit

Permalink
feat: fix the bug that spin is always showing when response error (ca…
Browse files Browse the repository at this point in the history
  • Loading branch information
leo220yuyaodog authored Dec 24, 2022
1 parent 6ea73e3 commit 86ae97d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/src/auth/CasLogout.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class CasLogout extends React.Component {
if (res.status === "ok") {
Setting.showMessage("success", "Logged out successfully");
this.props.onUpdateAccount(null);
this.onUpdateApplication(null);
const redirectUri = res.data2;
if (redirectUri !== null && redirectUri !== undefined && redirectUri !== "") {
Setting.goToLink(redirectUri);
Expand All @@ -49,6 +50,7 @@ class CasLogout extends React.Component {
Setting.goToLinkSoft(this, `/cas/${this.state.owner}/${this.state.applicationName}/login`);
}
} else {
this.onUpdateApplication(null);
Setting.showMessage("error", `Failed to log out: ${res.msg}`);
}
});
Expand Down
2 changes: 2 additions & 0 deletions web/src/auth/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class LoginPage extends React.Component {
});
} else {
// Setting.showMessage("error", res.msg);
this.onUpdateApplication(null);
this.setState({
application: res.data,
msg: res.msg,
Expand Down Expand Up @@ -133,6 +134,7 @@ class LoginPage extends React.Component {
applicationName: res.data.name,
});
} else {
this.onUpdateApplication(null);
Setting.showMessage("error", res.msg);
}
});
Expand Down

0 comments on commit 86ae97d

Please sign in to comment.