👷🏻 Auto-generate frontend client (#1320)

This commit is contained in:
Alejandra
2024-08-29 20:10:49 +02:00
committed by GitHub
parent e8c73ff614
commit bbad34aa8d
7 changed files with 100 additions and 31 deletions

View File

@@ -1,9 +1,9 @@
import axios from "axios"
import type {
AxiosError,
AxiosInstance,
AxiosRequestConfig,
AxiosResponse,
AxiosInstance,
} from "axios"
import { ApiError } from "./ApiError"
@@ -151,12 +151,12 @@ export const getHeaders = async (
)
if (isStringWithValue(token)) {
headers.Authorization = `Bearer ${token}`
headers["Authorization"] = `Bearer ${token}`
}
if (isStringWithValue(username) && isStringWithValue(password)) {
const credentials = base64(`${username}:${password}`)
headers.Authorization = `Basic ${credentials}`
headers["Authorization"] = `Basic ${credentials}`
}
if (options.body !== undefined) {