Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions backend/handlers/auth/local_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,8 @@
c.JSON(http.StatusInternalServerError, gin.H{"error": "Erreur lors de la génération du token"})
return
}

<<<<<<< Updated upstream
monitoring.UserLoginsTotal.WithLabelValues("success").Inc()
=======
monitoring.RecordUserLogin(true)
>>>>>>> Stashed changes
c.JSON(http.StatusOK, sessionResponse(token, au.ID, au.Email))
}
}
Expand All @@ -101,7 +97,7 @@
// Orphan recovery: if auth_users already exists for this email but no profile was ever created
// (e.g. the registration flow was interrupted), the handler verifies the password and returns
// a fresh token so the client can retry POST /auth/register — instead of returning 409 forever.
func LocalSignupHandler(provider authprovider.AuthProvider, db *bun.DB) gin.HandlerFunc {

Check failure on line 100 in backend/handlers/auth/local_auth.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=Buuuntyyy_SaferCloud&issues=AZ2F2vU7pu-F2ZDeCH66&open=AZ2F2vU7pu-F2ZDeCH66&pullRequest=9
return func(c *gin.Context) {
lp, ok := getLocalProvider(provider)
if !ok {
Expand Down
4 changes: 0 additions & 4 deletions backend/handlers/auth/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ func RegisterHandler(c *gin.Context, db *bun.DB, provider authprovider.AuthProvi
return
}

<<<<<<< Updated upstream
monitoring.UserRegistrationsTotal.Inc()
=======
monitoring.RecordUserRegistration()
>>>>>>> Stashed changes
mailer.SendWelcome(req.Email, req.Name)
c.JSON(http.StatusCreated, gin.H{"message": "Profil créé avec succès"})
}
Loading