Mizuki/mizuki-frontend/src/helpers/api.ts
2025-01-13 00:11:40 +01:00

11 lines
No EOL
255 B
TypeScript

export const checkIfLoggedIn = async () => {
try {
const resp = await fetch("/api/user/check", {
redirect: 'error',
credentials: 'include'
});
return resp.ok;
} catch {
return false;
}
};