import { Request } from 'express';

export function extractToken(req: Request): string | null {
  const authHeader = req.header('Authorization');
  if (!authHeader) return null;
  
  const [bearer, token] = authHeader.split(' ');
  if (bearer !== 'Bearer' || !token) return null;
  
  return token;
}