mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-08 08:12:48 +01:00
17 lines
402 B
TypeScript
17 lines
402 B
TypeScript
import { Configuration, DefaultApi } from '@/client'
|
|
import { useAuthStore } from '@/store/auth'
|
|
|
|
export function useAPI() {
|
|
const authStore = useAuthStore()
|
|
return new DefaultApi(
|
|
new Configuration({
|
|
basePath: '/api',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
Accept: 'application/json',
|
|
Authorization: `Bearer ${authStore.token}`
|
|
}
|
|
})
|
|
)
|
|
}
|