MCPcopy
hub / github.com/ModelEngine-Group/nexent / checkSessionValid

Function checkSessionValid

frontend/lib/session.ts:123–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121 * Check if session is valid (cookie exists and not expired)
122 */
123export const checkSessionValid = (): boolean => {
124 const expiresAt = getTokenExpiresAt();
125 if (expiresAt === null) return false;
126
127 const now = Date.now();
128 return expiresAt * 1000 > now;
129};
130
131/**
132 * Check if session has expired

Callers 8

fetchWithAuthFunction · 0.90
authService.tsFile · 0.90
useAuthenticationStateFunction · 0.90
useAuthorizationFunction · 0.90
useSessionManagerFunction · 0.90
scheduleExpiryCheckFunction · 0.90
reconcileExpiryFunction · 0.90
checkSessionExpiredFunction · 0.85

Calls 2

getTokenExpiresAtFunction · 0.85
nowMethod · 0.80

Tested by

no test coverage detected