door-alarm/web/composables/useToken.ts
Daniel Svitan ae7db8290c
All checks were successful
Gitea Build Action / build-go (push) Successful in 25s
Gitea Build Action / build-nuxt (push) Successful in 10m20s
🔨 Replaces native fetch with axios
2025-06-06 22:33:26 +02:00

11 lines
263 B
TypeScript

export function useToken() {
return useCookie<string | undefined>("token")
}
export function useHeaders(override: string | undefined = undefined) {
const token = useToken()
return {
Authorization: `Bearer ${override ?? token.value}`,
}
}