diff options
Diffstat (limited to 'modern/src/MainPage.js')
-rw-r--r-- | modern/src/MainPage.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modern/src/MainPage.js b/modern/src/MainPage.js index c70e8169..f81d5e74 100644 --- a/modern/src/MainPage.js +++ b/modern/src/MainPage.js @@ -40,13 +40,14 @@ const useStyles = makeStyles(theme => ({ })); const MainPage = ({ width }) => { - const [loading, setLoading] = useState(true); + const [loading, setLoading] = useState(!document.authenticated); const classes = useStyles(); const history = useHistory(); useEffect(() => { fetch('/api/session').then(response => { if (response.ok) { + document.authenticated = true; setLoading(false); } else { history.push('/login'); |