MCPcopy Create free account
hub / github.com/dailydotdev/apps / markSignedOut

Function markSignedOut

packages/shared/src/lib/signedOut.ts:9–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7const cookieScope = { domain: process.env.NEXT_PUBLIC_DOMAIN, path: '/' };
8
9export const markSignedOut = async (): Promise<void> => {
10 setCookie(SIGNED_OUT_COOKIE, 1, {
11 ...cookieScope,
12 maxAge: THIRTY_DAYS,
13 sameSite: 'lax',
14 });
15 try {
16 await globalThis.navigator?.credentials?.preventSilentAccess?.();
17 } catch {
18 // The cookie above is what the homepage reads; this is best effort.
19 }
20};
21
22export const clearSignedOut = (): void => {
23 if (getCookies([SIGNED_OUT_COOKIE])?.[SIGNED_OUT_COOKIE]) {

Callers 2

signedOut.spec.tsFile · 0.90
logoutFunction · 0.90

Calls 1

setCookieFunction · 0.90

Tested by

no test coverage detected