From f5b5608f9d85a190d951ca531f974b28145aae79 Mon Sep 17 00:00:00 2001 From: NotII <46204250+NotII@users.noreply.github.com> Date: Mon, 24 Mar 2025 13:44:44 +0000 Subject: [PATCH] erm what the sigma --- lib/api-utils.ts | 18 ++++++++++++++++++ next.config.mjs | 3 +++ 2 files changed, 21 insertions(+) diff --git a/lib/api-utils.ts b/lib/api-utils.ts index 6a3ac4c..24b7327 100644 --- a/lib/api-utils.ts +++ b/lib/api-utils.ts @@ -1,4 +1,5 @@ /** +<<<<<<< Updated upstream <<<<<<< Updated upstream * API utilities for consistent request handling */ @@ -35,6 +36,8 @@ export function getServerApiUrl(endpoint: string): string { ? `${apiUrl}${cleanEndpoint}` : `${apiUrl}/${cleanEndpoint}`; ======= +======= +>>>>>>> Stashed changes * API utilities for client and server-side requests */ @@ -71,25 +74,35 @@ export function getServerApiUrl(endpoint: string): string { const normalizedEndpoint = endpoint.startsWith('/') ? endpoint : `/${endpoint}`; return `${normalizedBaseUrl}${normalizedEndpoint}`; +<<<<<<< Updated upstream +>>>>>>> Stashed changes +======= >>>>>>> Stashed changes } /** * Get the authentication token from cookies or localStorage +<<<<<<< Updated upstream <<<<<<< Updated upstream */ export function getAuthToken(): string | null { if (typeof document === 'undefined') return null; // Guard for SSR ======= +======= +>>>>>>> Stashed changes * Only available in client-side code */ export function getAuthToken(): string | null { if (typeof document === 'undefined') return null; +<<<<<<< Updated upstream +>>>>>>> Stashed changes +======= >>>>>>> Stashed changes return document.cookie .split('; ') .find(row => row.startsWith('Authorization=')) +<<<<<<< Updated upstream <<<<<<< Updated upstream ?.split('=')[1] || localStorage.getItem('Authorization'); } @@ -120,6 +133,8 @@ export function createApiHeaders(token?: string | null, customHeaders: Record>>>>>> Stashed changes ?.split('=')[1] || (typeof localStorage !== 'undefined' ? localStorage.getItem('Authorization') : null); } @@ -140,6 +155,9 @@ export function createApiHeaders(token: string | null = null, additionalHeaders: headers.append('Authorization', `Bearer ${authToken}`); } +<<<<<<< Updated upstream +>>>>>>> Stashed changes +======= >>>>>>> Stashed changes return headers; } \ No newline at end of file diff --git a/next.config.mjs b/next.config.mjs index e28e8c9..f31f3ba 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -24,6 +24,7 @@ const nextConfig = { }, ]; }, +<<<<<<< Updated upstream <<<<<<< Updated upstream // Build optimization settings for slower CPUs experimental: { @@ -33,6 +34,8 @@ const nextConfig = { } }, ======= +>>>>>>> Stashed changes +======= >>>>>>> Stashed changes // Reduce memory usage during builds onDemandEntries: {