Rollback to 641200f3
This commit is contained in:
@@ -43,22 +43,9 @@ const trpcClient = trpc.createClient({
|
||||
url: "/api/trpc",
|
||||
transformer: superjson,
|
||||
fetch(input, init) {
|
||||
// Récupérer le token depuis localStorage
|
||||
const token = localStorage.getItem('auth_token');
|
||||
|
||||
const headers: HeadersInit = {
|
||||
...(init?.headers || {}),
|
||||
};
|
||||
|
||||
// Ajouter le header Authorization si un token existe
|
||||
if (token) {
|
||||
headers['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
return globalThis.fetch(input, {
|
||||
...(init ?? {}),
|
||||
credentials: "include",
|
||||
headers,
|
||||
});
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user