Navigate away from login page if already logged in. (#429)

- Fixes #370
This commit is contained in:
Dessalines 2021-09-19 16:28:44 -04:00 committed by GitHub
parent 0560e9dae9
commit 6929b87dae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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();