chore: add waf
This commit is contained in:
@@ -139,6 +139,23 @@ func UpdateMyProfile(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// GetMyProfile retourne le profil du client connecté
|
||||
// GET /api/v1/profile
|
||||
func GetMyProfile(c *gin.Context) {
|
||||
database := c.MustGet("database").(*db.Database)
|
||||
username, exists := c.Get("username")
|
||||
if !exists {
|
||||
c.JSON(http.StatusUnauthorized, gin.H{"error": "Non authentifié"})
|
||||
return
|
||||
}
|
||||
client, err := database.GetClientByUsername(username.(string))
|
||||
if err != nil || client == nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "Client non trouvé"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"success": true, "client": sanitizeClient(client)})
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// MODIFICATION PROFIL CLIENT (PAR ADMIN)
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user