redirect from login page if already logged in

This commit is contained in:
b1ek 2023-05-17 02:39:42 +10:00
parent 601b13feb6
commit ddaf8d4374
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 6 additions and 0 deletions

View File

@ -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>