diff --git a/src/types/auth.types.ts b/src/types/auth.types.ts index 67a1c5b..ee113b1 100644 --- a/src/types/auth.types.ts +++ b/src/types/auth.types.ts @@ -6,7 +6,6 @@ import { Request } from "express"; * This file consolidates all authentication-related type definitions * to prevent conflicts and ensure consistency across the application. */ - /** * Unified user interface for authentication * This interface combines all user properties needed across the application @@ -17,7 +16,6 @@ export interface AuthenticatedUser { role: string; isVerified: boolean; } - /** * Unified authenticated request interface * Extends Express Request with user and traceId properties @@ -26,7 +24,6 @@ export interface AuthenticatedRequest extends Request { user?: AuthenticatedUser; traceId?: string; } - /** * Decoded JWT user interface (from auth middleware) */ @@ -38,15 +35,6 @@ export interface DecodedUser { iat?: number; exp?: number; } - -// Legacy user interface for backward compatibility -export interface LegacyUser { - id: number | string; - role: string; - isVerified?: boolean; - email?: string; -} - /** * Type guard to check if user has required authentication properties */ @@ -59,7 +47,6 @@ export function isAuthenticatedUser(user: any): user is AuthenticatedUser { typeof user.isVerified === "boolean" ); } - /** * Helper function to convert DecodedUser to AuthenticatedUser */ @@ -73,17 +60,6 @@ export function toAuthenticatedUser( isVerified: decodedUser.isVerified || false, }; } - -/** - * Helper function to convert AuthenticatedUser to LegacyUser for backward compatibility - */ -export const toLegacyUser = (user: AuthenticatedUser): LegacyUser => ({ - id: user.id, - role: user.role, - isVerified: user.isVerified, - email: user.email, -}); - // Global Express namespace extension declare global { namespace Express {