Add frontend /login/oauth

This commit is contained in:
Yang Luo
2021-03-20 11:34:04 +08:00
parent 9980ef1975
commit 80c47dd8c6
6 changed files with 82 additions and 27 deletions

View File

@ -327,14 +327,14 @@ class App extends Component {
}
isDoorPages() {
return window.location.pathname.startsWith('/doors/');
return window.location.pathname.startsWith('/login/oauth');
}
render() {
if (this.isDoorPages()) {
return (
<Switch>
<Route exact path="/doors/:applicationName" render={(props) => this.renderLoginIfNotLoggedIn(<Face account={this.state.account} onLoggedIn={this.onLoggedIn.bind(this)} {...props} />)}/>
<Route exact path="/login/oauth" render={(props) => this.renderLoginIfNotLoggedIn(<Face type={"code"} {...props} />)}/>
</Switch>
)
}