my-portfolio/src/editor/js/editor.js

12 lines
264 B
JavaScript
Raw Normal View History

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 = './';
}
});
})