Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

526 B
Raw Blame
/**
 * Resolve a user's stored avatar reference to a renderable URL.
 *
 * The value is either an uploaded file name (served from /uploads/avatars) or,
 * for SSO users who never uploaded one, an absolute https URL taken from their
 * OIDC `picture` claim (#1399) — that one is passed through untouched.
 */
export function avatarUrl(user: { avatar?: string | null }): string | null {
  if (!user.avatar) return null;
  if (/^https:\/\//i.test(user.avatar)) return user.avatar;
  return `/uploads/avatars/${user.avatar}`;
}