auth.session.ts 409 B

123456789101112131415161718192021222324
  1. import { useSession } from "@solidjs/start/http"
  2. export interface AuthSession {
  3. account?: Record<
  4. string,
  5. {
  6. id: string
  7. email: string
  8. }
  9. >
  10. current?: string
  11. }
  12. export function useAuthSession() {
  13. return useSession<AuthSession>({
  14. password: "0".repeat(32),
  15. name: "auth",
  16. maxAge: 60 * 60 * 24 * 365,
  17. cookie: {
  18. secure: false,
  19. httpOnly: true,
  20. },
  21. })
  22. }