From 101a7fa10c3b6023a78729779317df6dea837c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Mon, 19 Sep 2022 11:00:57 +0200 Subject: [PATCH] Fix authRequired --- cmd/microrouterd/handler/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/microrouterd/handler/handler.go b/cmd/microrouterd/handler/handler.go index 68914f2..70ba489 100644 --- a/cmd/microrouterd/handler/handler.go +++ b/cmd/microrouterd/handler/handler.go @@ -180,7 +180,7 @@ func (h *Handler) proxy(serviceName string, route *routerclientpb.RoutesReply_Ro // Auth ctx, err := h.routerAuth.ForwardContext(c.Request, c) - if err != nil || authRequired { + if err != nil && authRequired { c.JSON(http.StatusUnauthorized, gin.H{ "status": http.StatusUnauthorized, "message": err,