Ajout de la connexion utilisateur

This commit is contained in:
Dayamond
2025-10-18 16:48:27 +02:00
parent 05eed05947
commit 387b2c32cf
4 changed files with 86 additions and 5 deletions
+12
View File
@@ -0,0 +1,12 @@
export default async function getUser() {
await fetch('http://localhost:8000/api/me', {
method: 'GET',
credentials: 'include',
headers: {
'Accept': 'application/json'
}
})
.then(res => res.json())
.then(data => console.log('Utilisateur connecté :', data))
.catch(err => console.error('Erreur :', err));
}