fix
Backend - Build & Lint / build (push) Failing after 16m48s

This commit is contained in:
2026-06-25 19:46:46 +02:00
parent b670bc3108
commit dae547cfa9
7 changed files with 79 additions and 41 deletions
+8
View File
@@ -838,6 +838,14 @@ func CreateUser(c *gin.Context) {
return
}
hashed, err := bcrypt.GenerateFromPassword([]byte(user.Password), bcrypt.DefaultCost)
if err != nil {
log.Printf("❌ [CREATE_USER] Erreur bcrypt: %v", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "Erreur traitement mot de passe"})
return
}
user.Password = string(hashed)
if err := database.CreateUser(&user); err != nil {
log.Printf("❌ [CREATE_USER] Erreur: %v", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "Erreur création"})