up
This commit is contained in:
parent
7c02d23e7d
commit
dfc71d1d03
@ -114,13 +114,10 @@ func LoginHandler(db *gorm.DB) http.HandlerFunc {
|
|||||||
// 5. Répondre en JSON pour Flutter
|
// 5. Répondre en JSON pour Flutter
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
json.NewEncoder(w).Encode(map[string]interface{}{
|
json.NewEncoder(w).Encode(map[string]interface{}{
|
||||||
"user": map[string]interface{}{
|
|
||||||
"id": user.ID,
|
"id": user.ID,
|
||||||
"username": user.Username,
|
"username": user.Username,
|
||||||
"email": user.Email,
|
"email": user.Email,
|
||||||
"token": tokenString, // <- virgule nécessaire ici
|
"token": tokenString,
|
||||||
// Ajoute d'autres informations utiles ici si nécessaire
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user