Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[server] Log userID on passkey auth failure

Neeraj Gupta9a683d65c99a
diff --git a/server/pkg/api/user.go b/server/pkg/api/user.go
index b919572aba..f0ede26f2f 100644
--- a/server/pkg/api/user.go
+++ b/server/pkg/api/user.go
@@ -4,6 +4,8 @@ import (
"database/sql"
"errors"
"fmt"
+ "github.com/gin-contrib/requestid"
+ "github.com/sirupsen/logrus"
"net/http"
"strconv"
"strings"
@@ -340,6 +342,10 @@ func (h *UserHandler) FinishPasskeyAuthenticationCeremony(c *gin.Context) {
err = h.UserController.PasskeyRepo.FinishAuthentication(&user, c.Request, uuid.MustParse(request.CeremonySessionID))
if err != nil {
+ reqID := requestid.Get(c)
+ logrus.WithField("req_id", reqID).
+ WithField("user_id", userID).
+ WithError(err).Error("Failed to finish passkey authentication ceremony")
handler.Error(c, stacktrace.Propagate(err, ""))
return
}