From 1e41383d04561b504ac8153085adde70a18adf5d Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 28 Jan 2022 10:28:21 +0000 Subject: [PATCH] Add debug logging for incoming CSAPI calls on authentication failure Will help to debug Complement failures, and just generally useful. --- internal/httputil/httpapi.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/httputil/httpapi.go b/internal/httputil/httpapi.go index 1fbd77da9..feb2aaa99 100644 --- a/internal/httputil/httpapi.go +++ b/internal/httputil/httpapi.go @@ -55,6 +55,7 @@ func MakeAuthAPI( h := func(req *http.Request) util.JSONResponse { device, err := auth.VerifyUserFromRequest(req, userAPI) if err != nil { + util.GetLogger((req.Context())).Debugf("VerifyUserFromRequest %s -> HTTP %d", req.RemoteAddr, err.Code) return *err } // add the user ID to the logger