feat: fix login page path after logout (#2493)

Co-authored-by: aidenlu <aiden_lu@wochacha.com>
This commit is contained in:
aiden 2023-11-21 23:37:35 +08:00 committed by GitHub
parent 23f4684e1d
commit 23d4488b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -492,7 +492,14 @@ class App extends Component {
sessionStorage.setItem("from", window.location.pathname); sessionStorage.setItem("from", window.location.pathname);
return <Redirect to="/login" />; return <Redirect to="/login" />;
} else if (this.state.account === undefined) { } else if (this.state.account === undefined) {
return null; sessionStorage.setItem("from", window.location.pathname);
const organization = localStorage.getItem("loginOrganization");
if (organization !== "undefined" && organization && organization !== "built-in") {
const loginPath = `/login/${organization}`;
return <Redirect to={loginPath} />;
} else {
return null;
}
} else { } else {
return component; return component;
} }

View File

@ -411,6 +411,7 @@ class LoginPage extends React.Component {
}; };
if (res.status === "ok") { if (res.status === "ok") {
localStorage.setItem("loginOrganization", values["organization"]);
if (res.data === NextMfa) { if (res.data === NextMfa) {
this.setState({ this.setState({
getVerifyTotp: () => { getVerifyTotp: () => {