no moulinette ?

This commit is contained in:
Guillem George 2026-05-16 11:14:39 +02:00
parent a0b5e97058
commit 2b7b6b8684
5 changed files with 50 additions and 16 deletions

View file

@ -134,10 +134,10 @@ async function authedAPIRequest(endpoint, options) {
return null;
}
if (!options.method) {
console.error("Invalid parameter: options (missing method)");
return null;
}
// if (!options.method) {
// console.error("Invalid parameter: options (missing method)");
// return null;
// }
if (!options.headers) {
options.headers = {};
@ -146,9 +146,9 @@ async function authedAPIRequest(endpoint, options) {
options.headers.Authorization = "Bearer " + localStorage.getItem("token");
const full_endpoint = import.meta.env.VITE_URL + "/api" + endpoint;
let response;
response = await fetch(full_endpoint, options);
const response = await fetch(full_endpoint, options);
if (response.status === 401) {
const response_err = await response.text();
@ -156,8 +156,6 @@ async function authedAPIRequest(endpoint, options) {
if (await refreshToken(null)) {
return await authedAPIRequest(endpoint, options);
}
return null;
}
localStorage.clear();