From bdc44c4bde71b9010ef531366a07ecccce7b98a6 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 16 Nov 2017 15:46:52 +0000 Subject: [PATCH] Log errors when there is an error validating token (#340) --- src/github.com/matrix-org/dendrite/clientapi/auth/auth.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go b/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go index b6a3efc28..56ee31ecb 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go +++ b/src/github.com/matrix-org/dendrite/clientapi/auth/auth.go @@ -25,6 +25,7 @@ import ( "strings" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" + "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" "github.com/matrix-org/util" ) @@ -62,10 +63,8 @@ func VerifyAccessToken(req *http.Request, deviceDB DeviceDatabase) (device *auth JSON: jsonerror.UnknownToken("Unknown token"), } } else { - resErr = &util.JSONResponse{ - Code: 500, - JSON: jsonerror.Unknown("Failed to check access token"), - } + jsonErr := httputil.LogThenError(req, err) + resErr = &jsonErr } } return