MCPcopy Create free account
hub / github.com/TanStack/router / getAppSession

Function getAppSession

examples/solid/start-basic-auth/src/utils/session.ts:9–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7}
8
9export function getAppSession() {
10 const password = process.env.SESSION_PASSWORD
11 if (!password || password.length < 32) {
12 throw new Error('Set SESSION_PASSWORD to at least 32 characters')
13 }
14
15 return getIronSession<SessionUser>(
16 { read: getCookie, write: setCookie },
17 {
18 cookieName: 'app-session',
19 password,
20 ttl: 7 * 24 * 60 * 60,
21 cookieOptions: {
22 httpOnly: true,
23 sameSite: 'lax',
24 secure: process.env.NODE_ENV === 'production',
25 path: '/',
26 },
27 },
28 )
29}

Callers 4

signup.tsxFile · 0.90
logout.tsxFile · 0.90
_authed.tsxFile · 0.90
__root.tsxFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected