18 lines
467 B
TypeScript
18 lines
467 B
TypeScript
// utils/checkSession.ts
|
|
|
|
export async function checkSession(): Promise<boolean> {
|
|
try {
|
|
// Beispiel: prüfe ob ein erwartetes globales Fenster-Objekt noch existiert
|
|
const expectedGlobalVar = "win_kueID"; // oder "win_deviceName", je nach System
|
|
|
|
if (typeof window === "undefined") return false;
|
|
|
|
return (
|
|
(window as unknown as Record<string, unknown>)[expectedGlobalVar] !==
|
|
undefined
|
|
);
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|