Skip to content

Commit d48db36

Browse files
Lucas Maupinclaude
authored andcommitted
fix: remove credentials:include from REST requests — OSC proxy omits Allow-Credentials header
Catalog service instances on OSC do not propagate Access-Control-Allow-Credentials, so credentials:include caused CORS failures for all REST calls from the deployed studio. REST auth still uses Authorization header; WebSocket auth uses the OSC cookie set by sat.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1507cd4 commit d48db36

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/lib/api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ async function request<T>(path: string, init?: RequestInit): Promise<T> {
99
const contentHeaders: Record<string, string> = init?.body !== undefined ? { 'Content-Type': 'application/json' } : {}
1010

1111
const res = await fetch(`${BASE}${path}`, {
12-
credentials: isOnOsc() ? 'include' : 'same-origin',
1312
headers: { ...contentHeaders, ...authHeaders },
1413
...init,
1514
})

src/pages/ControllerPage/TimerBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useRef, useState, useCallback } from 'react'
22
import { BASE } from '@/lib/api'
3-
import { authenticateWithOpenLive, getApiToken, isOnOsc } from '@/lib/sat'
3+
import { authenticateWithOpenLive, getApiToken } from '@/lib/sat'
44
import { useProgramStartMs, getProgramMode, COUNTDOWN_WINDOW_MS, PROGRAM_WINDOW_MS } from '@/store/programClock.store'
55
import { useProductionStore } from '@/store/production.store'
66
import { useProductionsStore } from '@/store/productions.store'
@@ -14,7 +14,7 @@ async function fetchServerOffset(): Promise<number> {
1414
const res = await fetch(`${BASE}/api/v1/ping`, {
1515
method: 'HEAD',
1616
cache: 'no-store',
17-
credentials: isOnOsc() ? 'include' : 'same-origin',
17+
credentials: 'same-origin',
1818
headers: token ? { Authorization: `Bearer ${token}` } : {},
1919
})
2020
const after = Date.now()

0 commit comments

Comments
 (0)