32 lines
696 B
TypeScript
32 lines
696 B
TypeScript
type JWTConfig = {
|
|
secret: string;
|
|
expiration: string | number;
|
|
issuer: string;
|
|
algorithm: string;
|
|
};
|
|
|
|
interface CookieOptions {
|
|
secure?: boolean;
|
|
httpOnly?: boolean;
|
|
sameSite?: "Strict" | "Lax" | "None";
|
|
path?: string;
|
|
domain?: string;
|
|
}
|
|
|
|
interface UserSession {
|
|
id: string;
|
|
username: string;
|
|
email: string;
|
|
isVerified: boolean;
|
|
displayName: string | null;
|
|
createdAt: string; // ISO date string
|
|
updatedAt?: string; // ISO date string, optional
|
|
iat?: number; // issued at (added by JWT libs)
|
|
exp?: number; // expiration (added by JWT libs)
|
|
}
|
|
|
|
interface SessionData extends UserSession {
|
|
userAgent: string;
|
|
}
|
|
|
|
export type { JWTConfig, CookieOptions, UserSession, SessionData };
|