Navigate away from login page if already logged in. (#429)
- Fixes #370
This commit is contained in:
parent
0560e9dae9
commit
6929b87dae
1 changed files with 7 additions and 0 deletions
|
@ -105,6 +105,13 @@ export class Login extends Component<any, State> {
|
|||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// Navigate to home if already logged in
|
||||
if (UserService.Instance.myUserInfo) {
|
||||
this.context.router.history.push("/");
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (isBrowser()) {
|
||||
this.subscription.unsubscribe();
|
||||
|
|
Loading…
Reference in a new issue