[SPRINT-1] feat: Add device details to session response

SUBTASK-002: Auth session details
- Extend Session type with deviceType, deviceName, browser, os, countryCode, city
- getSessions controller now returns extended device information

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Adrian Flores Cortes 2026-02-03 23:49:28 -06:00
parent e7745d18b9
commit 85803d92fe
2 changed files with 11 additions and 0 deletions

View File

@ -417,6 +417,11 @@ export const getSessions = async (req: Request, res: Response, next: NextFunctio
id: s.id,
userAgent: s.userAgent,
ipAddress: s.ipAddress,
deviceType: s.deviceType,
browser: s.browser,
os: s.os,
countryCode: s.countryCode,
city: s.city,
createdAt: s.createdAt,
lastActiveAt: s.lastActiveAt,
isCurrent: s.id === req.sessionId,

View File

@ -88,6 +88,12 @@ export interface Session {
userAgent?: string;
ipAddress?: string;
deviceInfo?: Record<string, unknown>;
deviceType?: string;
deviceName?: string;
browser?: string;
os?: string;
countryCode?: string;
city?: string;
expiresAt: Date;
revokedAt?: Date;
createdAt: Date;