2024-09-29 13:56:38 +02:00
|
|
|
export interface ILoginSession {
|
|
|
|
|
id: string;
|
|
|
|
|
data: {
|
2026-04-20 08:12:07 +00:00
|
|
|
userId: string | null;
|
2024-09-29 13:56:38 +02:00
|
|
|
validUntil: number;
|
|
|
|
|
invalidated: boolean;
|
2026-04-20 08:12:07 +00:00
|
|
|
/**
|
|
|
|
|
* legacy plaintext refresh token field kept so existing sessions can migrate on first use
|
|
|
|
|
*/
|
|
|
|
|
refreshToken?: string | null;
|
|
|
|
|
refreshTokenHash?: string | null;
|
|
|
|
|
rotatedRefreshTokenHashes?: string[];
|
|
|
|
|
transferTokenHash?: string | null;
|
|
|
|
|
transferTokenExpiresAt?: number | null;
|
2024-09-29 13:56:38 +02:00
|
|
|
/**
|
|
|
|
|
* a device id that can be used to share the login session
|
|
|
|
|
* in different contexts on the same device
|
|
|
|
|
*/
|
2026-04-20 08:12:07 +00:00
|
|
|
deviceId?: string | null;
|
2025-12-01 18:56:16 +00:00
|
|
|
/**
|
|
|
|
|
* Device metadata for session display
|
|
|
|
|
*/
|
|
|
|
|
deviceInfo?: {
|
|
|
|
|
deviceName: string;
|
|
|
|
|
browser: string;
|
|
|
|
|
os: string;
|
|
|
|
|
ip: string;
|
2026-04-20 08:12:07 +00:00
|
|
|
} | null;
|
2025-12-01 18:56:16 +00:00
|
|
|
/**
|
|
|
|
|
* When this session was created
|
|
|
|
|
*/
|
|
|
|
|
createdAt?: number;
|
|
|
|
|
/**
|
|
|
|
|
* Last time this session was active (e.g., refreshed)
|
|
|
|
|
*/
|
|
|
|
|
lastActive?: number;
|
2024-09-29 13:56:38 +02:00
|
|
|
};
|
|
|
|
|
}
|