12 lines
264 B
JavaScript
12 lines
264 B
JavaScript
|
|
||
|
document.addEventListener('DOMContentLoaded', e =>
|
||
|
{
|
||
|
// check if the user is logged in, if not redirect to login
|
||
|
fetch('/api/user/isLoggedIn').then(res =>
|
||
|
{
|
||
|
if (!res.ok)
|
||
|
{
|
||
|
window.location.href = './';
|
||
|
}
|
||
|
});
|
||
|
})
|