diff --git a/web/src/App.js b/web/src/App.js index 21e885f3..6f980693 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -235,6 +235,8 @@ class App extends Component { AuthBackend.logout() .then((res) => { if (res.status === "ok") { + const owner = this.state.account.owner; + this.setState({ account: null }); @@ -243,7 +245,9 @@ class App extends Component { let redirectUri = res.data2; if (redirectUri !== null && redirectUri !== undefined && redirectUri !== "") { Setting.goToLink(redirectUri); - }else{ + } else if (owner !== "built-in") { + Setting.goToLink(`${window.location.origin}/login/${owner}`); + } else { Setting.goToLinkSoft(this, "/"); } } else { @@ -669,6 +673,7 @@ class App extends Component { this.renderHomeIfLoggedIn()} /> this.renderHomeIfLoggedIn( {this.onUpdateAccount(account);}} />)} /> this.renderHomeIfLoggedIn()} /> + this.renderHomeIfLoggedIn()} /> {this.onUpdateAccount(account);}} />} /> {this.onUpdateAccount(account);}} />} /> {this.onUpdateAccount(account);}} />} /> diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index 22e50b94..6407b205 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -191,6 +191,10 @@ class LoginPage extends React.Component { values["type"] = "saml"; } + if (this.state.owner != null) { + values["organization"] = this.state.owner; + } + AuthBackend.login(values, oAuthParams) .then((res) => { if (res.status === "ok") {