Line data Source code
1 : import {
2 : attachUnifiedRemintInterceptor,
3 : cloudRetryPolicy
4 : } from '@/platform/auth/unified/remintRetry'
5 : import { setIngestApiAuth } from '@/platform/remote/ingest/ingestApi'
6 : import { useAuthStore } from '@/stores/authStore'
7 : import { attachRetryableStatusRetry } from '@/utils/axiosRetryableStatus'
8 :
9 2355 : export function installWorkspaceApiAuth(): void {
10 2355 : setIngestApiAuth({
11 : getWorkspaceAuthHeader: () =>
12 : useAuthStore().getWorkspaceAuthHeaderOrThrow(),
13 : getFirebaseAuthHeader: () => useAuthStore().getFirebaseAuthHeaderOrThrow(),
14 : attachRetryInterceptor: (client) => {
15 2355 : attachRetryableStatusRetry(client, { policy: cloudRetryPolicy() })
16 2355 : attachUnifiedRemintInterceptor(client)
17 : }
18 : })
19 : }
|