fix self-hosting auth issue with API_URL missing

This commit is contained in:
Francis Cao committed 2026-06-04 10:19:23 -07:00
1 parent a52f32604a
commit 8473dea1ca
3 files changed
+13 -4

No files matched your search

+11 -2
View File
@@ -20,13 +20,22 @@ describe('getApiUrl', () => {
).toBe('/analytics/internal-api/websites');
});
test('keeps app routes on the local api path', () => {
test('uses a relative API_URL for auth routes', () => {
expect(
getApiUrl('/auth/verify', {
apiUrl: '/internal-api',
basePath: '/analytics',
}),
).toBe('/analytics/api/auth/verify');
).toBe('/analytics/internal-api/auth/verify');
});
test('keeps config routes on the local api path', () => {
expect(
getApiUrl('/config', {
apiUrl: '/internal-api',
basePath: '/analytics',
}),
).toBe('/analytics/api/config');
});
test('returns absolute input urls unchanged', () => {