Fix types for session
| @@ -1,6 +1,24 @@ | ||
| 1 | 1 | import { UserDirectoryList, User } from "./src/users"; |
| 2 | +import { CsrfSyncedToken } from "csrf-sync"; | |
| 2 | 3 | |
| 3 | 4 | declare global { |
| 5 | + declare namespace CookieSessionInterfaces { | |
| 6 | + export interface CookieSessionObject { | |
| 7 | + /** | |
| 8 | + * The CSRF token for the session. | |
| 9 | + */ | |
| 10 | + csrfToken: CsrfSyncedToken; | |
| 11 | + /** | |
| 12 | + * Authenticated user handle. | |
| 13 | + */ | |
| 14 | + handle: string; | |
| 15 | + /** | |
| 16 | + * Last time the session was extended. | |
| 17 | + */ | |
| 18 | + touch: number; | |
| 19 | + } | |
| 20 | + } | |
| 21 | + | |
| 4 | 22 | namespace Express { |
| 5 | 23 | export interface Request { |
| 6 | 24 | user: { |
| @@ -15,11 +33,3 @@ declare global { | ||
| 15 | 33 | */ |
| 16 | 34 | var DATA_ROOT: string; |
| 17 | 35 | } |
| 18 | - | |
| 19 | -declare module 'express-session' { | |
| 20 | - export interface SessionData { | |
| 21 | - handle: string; | |
| 22 | - touch: number; | |
| 23 | - // other properties... | |
| 24 | - } | |
| 25 | - } | |