Ajout de la connexion utilisateur
This commit is contained in:
1 parent
05eed05947
commit
387b2c32cf
4 files changed
+86
-5
No files matched your search
@@ -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));
|
||||
}
|
||||
Reference in new issue
Block a user