From 88e32ddd7fe062822b04d1c07d9ed6cac6ebbe4b Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Thu, 29 Feb 2024 12:17:22 +0300 Subject: [PATCH] [#107] Add return on error in tokenizer middleware Signed-off-by: Denis Kirillov --- cmd/http-gw/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/http-gw/app.go b/cmd/http-gw/app.go index aabb22b..4532520 100644 --- a/cmd/http-gw/app.go +++ b/cmd/http-gw/app.go @@ -549,8 +549,9 @@ func (a *app) tokenizer(h fasthttp.RequestHandler) fasthttp.RequestHandler { return func(req *fasthttp.RequestCtx) { appCtx, err := tokens.StoreBearerTokenAppCtx(a.ctx, req) if err != nil { - a.log.Error(logs.CouldNotFetchAndStoreBearerToken, zap.Error(err)) + a.log.Error(logs.CouldNotFetchAndStoreBearerToken, zap.Uint64("id", req.ID()), zap.Error(err)) response.Error(req, "could not fetch and store bearer token: "+err.Error(), fasthttp.StatusBadRequest) + return } utils.SetContextToRequest(appCtx, req) h(req)