revert api url changes. exclude auth from API_URL

This commit is contained in:
Francis Cao committed 2026-06-04 14:45:50 -07:00
1 parent 8473dea1ca
commit 4956380942
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -160,7 +160,7 @@ if (isRelativeUrl(apiUrl)) {
}
} else if (apiUrl) {
beforeFilesRewrites.push({
source: '/api/:path((?!config(?:/|$)).*)',
source: '/api/:path((?!auth(?:/|$)|config(?:/|$)).*)',
destination: `${apiUrl.replace(/\/+$/, '')}/:path`,
});
}
+2 -2
View File
@@ -20,13 +20,13 @@ describe('getApiUrl', () => {
).toBe('/analytics/internal-api/websites');
});
test('uses a relative API_URL for auth routes', () => {
test('keeps app routes on the local api path', () => {
expect(
getApiUrl('/auth/verify', {
apiUrl: '/internal-api',
basePath: '/analytics',
}),
).toBe('/analytics/internal-api/auth/verify');
).toBe('/analytics/api/auth/verify');
});
test('keeps config routes on the local api path', () => {
+1 -1
View File
@@ -3,7 +3,7 @@ type ApiUrlOptions = {
basePath?: string;
};
const APP_ROUTE_PATTERNS: RegExp[] = [/^\/config(\/|$)/];
const APP_ROUTE_PATTERNS: RegExp[] = [/^\/auth(\/|$)/, /^\/config(\/|$)/];
function trimTrailingSlash(value: string) {
return value.replace(/\/+$/, '');