import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  async headers() {
    return [{
      source: '/invitations/accept',
      // Email links carry a query token. Apply before any preloads or hydration.
      headers: [{ key: 'Referrer-Policy', value: 'no-referrer' }],
    }];
  },
  turbopack: {
    resolveAlias: {
      '@alqove/api-client': '../packages/api-client/src/index.ts',
      '@alqove/types': '../packages/types/src/index.ts',
      '@alqove/shared': '../packages/shared/src/index.ts',
    },
  },
  images: {
    // Store logos on the check-in branding shell are served from the API/CDN.
    // Scope this to the real CDN host(s) before production — `**` is permissive
    // for local/dev where the logo origin varies.
    remotePatterns: [
      { protocol: "https", hostname: "**" },
      { protocol: "http", hostname: "localhost" },
    ],
  },
};

export default nextConfig;
