Amélioration 2FA

This commit is contained in:
2026-06-14 22:13:33 +02:00
parent 13ec48a8f3
commit 402d690e96
4 changed files with 228 additions and 5 deletions
+3 -3
View File
@@ -5,9 +5,11 @@ const BASE = import.meta.env.VITE_API_URL || '/api';
function authHeaders() {
const token = localStorage.getItem('cl_token');
const investisseurId = localStorage.getItem('cl_investisseur_id');
const deviceToken = localStorage.getItem('cl_device_token');
const h = {};
if (token) h['Authorization'] = `Bearer ${token}`;
if (investisseurId) h['X-Investisseur-Id'] = investisseurId;
if (deviceToken) h['X-Device-Token'] = deviceToken;
return h;
}
@@ -63,6 +65,4 @@ export const api = {
}),
exportUrl: (path, params) => {
const qs = params ? '?' + new URLSearchParams(params).toString() : '';
return BASE + path + qs;
},
};