feat(frontend): Send JWT with every request

This commit is contained in:
2025-04-20 18:34:56 +02:00
parent eec15dd7ef
commit 28954f7c2e
3 changed files with 13 additions and 6 deletions

View File

@@ -5,12 +5,15 @@ import { cleanDoubleSlashes, withoutTrailingSlash } from 'ufo'
export function useApplicationFormApi() {
const appBaseUrl = useRuntimeConfig().app.baseURL
const { serverApiBaseUrl, serverApiBasePath, clientProxyBasePath } = useRuntimeConfig().public
const { jwt } = useAuth()
const basePath = withoutTrailingSlash(
cleanDoubleSlashes(import.meta.client ? appBaseUrl + clientProxyBasePath : serverApiBaseUrl + serverApiBasePath)
)
const applicationFormApiClient = new ApplicationFormApi(new Configuration({ basePath }))
const applicationFormApiClient = new ApplicationFormApi(
new Configuration({ basePath, headers: { Authorization: jwt.value ?? '' } })
)
async function createApplicationForm(
createApplicationFormDto: CreateApplicationFormDto