Compare commits

...

1 Commits

Author SHA1 Message Date
nav
66c49ff654 feat(frontend): apply API key headers to center auth client 2026-05-13 06:58:18 +00:00

View File

@@ -19,10 +19,21 @@ type RefreshResponse = {
function centerClient() {
const cfg = getRuntimeConfig()
return axios.create({
const client = axios.create({
baseURL: cfg.centerApiBase,
timeout: 10000,
})
client.interceptors.request.use((request) => {
const { apiKey } = getRuntimeConfig()
const requestId = crypto.randomUUID()
if (apiKey) request.headers['x-api-key'] = apiKey
request.headers['x-request-id'] = requestId
request.headers['x-client-name'] = 'fabric-frontend'
return request
})
return client
}
export async function loginCenter(payload: LoginPayload): Promise<AuthSession> {