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

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() { componentWillUnmount() {
if (isBrowser()) { if (isBrowser()) {
this.subscription.unsubscribe(); this.subscription.unsubscribe();