first commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { ApiClient } from './client'
|
||||
import { session } from '../auth/session'
|
||||
import { createAuthRefresh } from '../auth/refresh'
|
||||
|
||||
const baseUrl = import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:8000/api/v1'
|
||||
|
||||
const normalizedBaseUrl = baseUrl.replace(/\/$/, '')
|
||||
export const refreshAuth = createAuthRefresh(normalizedBaseUrl)
|
||||
export const api = new ApiClient(normalizedBaseUrl, () => session.get()?.access_token || null, refreshAuth)
|
||||
Reference in New Issue
Block a user