Remove onLoggedIn().

This commit is contained in:
Yang Luo
2021-03-26 21:57:54 +08:00
parent 9af2ac49be
commit 6880c28194
4 changed files with 4 additions and 6 deletions

View File

@ -309,11 +309,11 @@ class App extends Component {
</Menu>
</Header>
<Switch>
<Route exact path="/register" render={(props) => this.renderHomeIfLoggedIn(<RegisterPage onLoggedIn={this.onLoggedIn.bind(this)} {...props} />)}/>
<Route exact path="/register" render={(props) => this.renderHomeIfLoggedIn(<RegisterPage {...props} />)}/>
<Route exact path="/result" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...props} />)}/>
<Route exact path="/login" render={(props) => this.renderHomeIfLoggedIn(<SelfLoginPage onLoggedIn={this.onLoggedIn.bind(this)} {...props} />)}/>
<Route exact path="/login" render={(props) => this.renderHomeIfLoggedIn(<SelfLoginPage {...props} />)}/>
<Route exact path="/callback" component={AuthCallback}/>
<Route exact path="/" render={(props) => this.renderLoginIfNotLoggedIn(<HomePage account={this.state.account} onLoggedIn={this.onLoggedIn.bind(this)} {...props} />)}/>
<Route exact path="/" render={(props) => this.renderLoginIfNotLoggedIn(<HomePage account={this.state.account} {...props} />)}/>
<Route exact path="/account" render={(props) => this.renderLoginIfNotLoggedIn(<AccountPage account={this.state.account} {...props} />)}/>
<Route exact path="/organizations" render={(props) => this.renderLoginIfNotLoggedIn(<OrganizationListPage account={this.state.account} {...props} />)}/>
<Route exact path="/organizations/:organizationName" render={(props) => this.renderLoginIfNotLoggedIn(<OrganizationEditPage account={this.state.account} {...props} />)}/>

View File

@ -74,7 +74,6 @@ class AuthCallback extends React.Component {
if (res.status === 'ok') {
const responseType = this.getResponseType();
if (responseType === "login") {
// this.props.onLoggedIn();
Util.showMessage("success", `Logged in successfully`);
Util.goToLink("/");
} else if (responseType === "code") {

View File

@ -88,7 +88,6 @@ class LoginPage extends React.Component {
if (res.status === 'ok') {
const responseType = this.state.type;
if (responseType === "login") {
// this.props.onLoggedIn();
Util.showMessage("success", `Logged in successfully`);
Util.goToLink("/");
} else if (responseType === "code") {

View File

@ -19,7 +19,7 @@ import {authConfig} from "./Auth";
class SelfLoginPage extends React.Component {
render() {
return (
<LoginPage type={"login"} applicationName={authConfig.appName} account={this.props.account} onLoggedIn={this.props.onLoggedIn.bind(this)} {...this.props} />
<LoginPage type={"login"} applicationName={authConfig.appName} account={this.props.account} {...this.props} />
)
}
}