summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src/context/auth.session.ts
blob: 726b6c8346ce9f5e9813e53cff8444592814a986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { useSession } from "@solidjs/start/http"

export interface AuthSession {
  account?: Record<
    string,
    {
      id: string
      email: string
    }
  >
  current?: string
}

export function useAuthSession() {
  return useSession<AuthSession>({
    password: "0".repeat(32),
    name: "auth",
    maxAge: 60 * 60 * 24 * 365,
    cookie: {
      secure: false,
      httpOnly: true,
    },
  })
}