redirect from login page if already logged in
This commit is contained in:
parent
601b13feb6
commit
ddaf8d4374
|
@ -8,6 +8,8 @@ import FloatingBox from '../../components/UI/FloatingBox';
|
||||||
import * as OpenID from 'oidc-client-ts';
|
import * as OpenID from 'oidc-client-ts';
|
||||||
import constants from '../../constants';
|
import constants from '../../constants';
|
||||||
|
|
||||||
|
import { User } from '../../API/User';
|
||||||
|
|
||||||
const { OIDCConfig } = constants;
|
const { OIDCConfig } = constants;
|
||||||
|
|
||||||
const LoginButton = styled(BlueButton)`
|
const LoginButton = styled(BlueButton)`
|
||||||
|
@ -66,6 +68,10 @@ export default class LoginPage extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
|
if (User.isCached())
|
||||||
|
window.location.href = '/';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{height: '65vh'}}>
|
<div style={{height: '65vh'}}>
|
||||||
<FloatingBox>
|
<FloatingBox>
|
||||||
|
|
Loading…
Reference in New Issue