fix(api): support shared session cookie domain
Build & Deploy / Build & Push Docker Image (push) Successful in 2m49s
Test / Type Check (all packages) (push) Successful in 55s
Build & Deploy / Deploy to VPS (push) Successful in 3s
Test / API Unit Tests (push) Successful in 48s
Test / Homepage Unit Tests (push) Successful in 46s
Test / Storefront Unit Tests (push) Successful in 47s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 59s

This commit is contained in:
root
2026-07-02 15:10:40 -04:00
parent a947e48c49
commit ad5f5ebab7
4 changed files with 80 additions and 14 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ describe('dashboard apiFetch', () => {
}))
})
it('keeps browser requests on the dashboard proxy even when a public API origin is configured', async () => {
it('normalizes a public API origin to the versioned API base', async () => {
installBrowser()
process.env.NEXT_PUBLIC_API_URL = 'https://api.rentaldrivego.ma'
const fetchMock = vi.fn(async () => ({
@@ -51,7 +51,7 @@ describe('dashboard apiFetch', () => {
const { apiFetch } = await import('./api')
await apiFetch('/auth/account/start', { method: 'POST', body: JSON.stringify({}) })
expect(fetchMock).toHaveBeenCalledWith('/dashboard/api/v1/auth/account/start', expect.any(Object))
expect(fetchMock).toHaveBeenCalledWith('https://api.rentaldrivego.ma/api/v1/auth/account/start', expect.any(Object))
})
it('does not force JSON content type for FormData payloads', async () => {
+1 -1
View File
@@ -6,7 +6,7 @@ function normalizeApiBase(value: string): string {
export const API_BASE = normalizeApiBase(
typeof window === 'undefined'
? (process.env.API_INTERNAL_URL || 'http://localhost:4000/api/v1')
: '/dashboard/api/v1',
: (process.env.NEXT_PUBLIC_API_URL || '/dashboard/api/v1'),
)
export const EMPLOYEE_PROFILE_KEY = 'employee_profile'