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 constants from '../../constants';
|
||||
|
||||
import { User } from '../../API/User';
|
||||
|
||||
const { OIDCConfig } = constants;
|
||||
|
||||
const LoginButton = styled(BlueButton)`
|
||||
|
@ -66,6 +68,10 @@ export default class LoginPage extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
|
||||
if (User.isCached())
|
||||
window.location.href = '/';
|
||||
|
||||
return (
|
||||
<div style={{height: '65vh'}}>
|
||||
<FloatingBox>
|
||||
|
|
Loading…
Reference in New Issue