Added check for if login cookie expires
This commit is contained in:
@@ -256,7 +256,13 @@
|
||||
setAmoledTheme();
|
||||
|
||||
if (isLoggedIn && !isYTBackend()) {
|
||||
loadNotifications().catch(() => authStore.set(null));
|
||||
loadNotifications().catch(() => logout());
|
||||
}
|
||||
|
||||
if ($rawMasterKeyStore) {
|
||||
fetch('/api/user/isLoggedIn', { method: 'GET', credentials: 'same-origin' }).catch(() => {
|
||||
logout();
|
||||
});
|
||||
}
|
||||
|
||||
resetScroll();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export async function GET({ locals }) {
|
||||
if (!locals.userId) {
|
||||
throw error(401);
|
||||
}
|
||||
|
||||
return new Response();
|
||||
}
|
||||
Reference in New Issue
Block a user