erm what the sigma
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
|
<<<<<<< Updated upstream
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
* API utilities for consistent request handling
|
* API utilities for consistent request handling
|
||||||
*/
|
*/
|
||||||
@@ -35,6 +36,8 @@ export function getServerApiUrl(endpoint: string): string {
|
|||||||
? `${apiUrl}${cleanEndpoint}`
|
? `${apiUrl}${cleanEndpoint}`
|
||||||
: `${apiUrl}/${cleanEndpoint}`;
|
: `${apiUrl}/${cleanEndpoint}`;
|
||||||
=======
|
=======
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
* API utilities for client and server-side requests
|
* API utilities for client and server-side requests
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -71,25 +74,35 @@ export function getServerApiUrl(endpoint: string): string {
|
|||||||
const normalizedEndpoint = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
|
const normalizedEndpoint = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
|
||||||
|
|
||||||
return `${normalizedBaseUrl}${normalizedEndpoint}`;
|
return `${normalizedBaseUrl}${normalizedEndpoint}`;
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the authentication token from cookies or localStorage
|
* Get the authentication token from cookies or localStorage
|
||||||
|
<<<<<<< Updated upstream
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
*/
|
*/
|
||||||
export function getAuthToken(): string | null {
|
export function getAuthToken(): string | null {
|
||||||
if (typeof document === 'undefined') return null; // Guard for SSR
|
if (typeof document === 'undefined') return null; // Guard for SSR
|
||||||
=======
|
=======
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
* Only available in client-side code
|
* Only available in client-side code
|
||||||
*/
|
*/
|
||||||
export function getAuthToken(): string | null {
|
export function getAuthToken(): string | null {
|
||||||
if (typeof document === 'undefined') return null;
|
if (typeof document === 'undefined') return null;
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
return document.cookie
|
return document.cookie
|
||||||
.split('; ')
|
.split('; ')
|
||||||
.find(row => row.startsWith('Authorization='))
|
.find(row => row.startsWith('Authorization='))
|
||||||
|
<<<<<<< Updated upstream
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
?.split('=')[1] || localStorage.getItem('Authorization');
|
?.split('=')[1] || localStorage.getItem('Authorization');
|
||||||
}
|
}
|
||||||
@@ -120,6 +133,8 @@ export function createApiHeaders(token?: string | null, customHeaders: Record<st
|
|||||||
}
|
}
|
||||||
|
|
||||||
=======
|
=======
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
?.split('=')[1] ||
|
?.split('=')[1] ||
|
||||||
(typeof localStorage !== 'undefined' ? localStorage.getItem('Authorization') : null);
|
(typeof localStorage !== 'undefined' ? localStorage.getItem('Authorization') : null);
|
||||||
}
|
}
|
||||||
@@ -140,6 +155,9 @@ export function createApiHeaders(token: string | null = null, additionalHeaders:
|
|||||||
headers.append('Authorization', `Bearer ${authToken}`);
|
headers.append('Authorization', `Bearer ${authToken}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,7 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
<<<<<<< Updated upstream
|
||||||
<<<<<<< Updated upstream
|
<<<<<<< Updated upstream
|
||||||
// Build optimization settings for slower CPUs
|
// Build optimization settings for slower CPUs
|
||||||
experimental: {
|
experimental: {
|
||||||
@@ -33,6 +34,8 @@ const nextConfig = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
=======
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
=======
|
||||||
>>>>>>> Stashed changes
|
>>>>>>> Stashed changes
|
||||||
// Reduce memory usage during builds
|
// Reduce memory usage during builds
|
||||||
onDemandEntries: {
|
onDemandEntries: {
|
||||||
|
|||||||
Reference in New Issue
Block a user