export function getUserIdFromToken(token: string): string | null {
  try {
    const payload = JSON.parse(atob(token.split(".")[1]));
    return payload.sub ?? payload.id ?? payload.userId ?? null;
  } catch {
    return null;
  }
}
