From 23d4488b647161da67c530ddb61bbdfff0981698 Mon Sep 17 00:00:00 2001 From: aiden Date: Tue, 21 Nov 2023 23:37:35 +0800 Subject: [PATCH] feat: fix login page path after logout (#2493) Co-authored-by: aidenlu --- web/src/App.js | 9 ++++++++- web/src/auth/LoginPage.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/src/App.js b/web/src/App.js index 77560c8d..4741eef5 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -492,7 +492,14 @@ class App extends Component { sessionStorage.setItem("from", window.location.pathname); return ; } 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 ; + } else { + return null; + } } else { return component; } diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index a7f862d6..49f8401c 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -411,6 +411,7 @@ class LoginPage extends React.Component { }; if (res.status === "ok") { + localStorage.setItem("loginOrganization", values["organization"]); if (res.data === NextMfa) { this.setState({ getVerifyTotp: () => {