From 1dbf78235606ecd715f84f004e6459225c101031 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 21 Nov 2016 16:17:42 +0100 Subject: [PATCH] avoid c.Next() and c.Abort() both being executed --- router/middleware/session/team.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/router/middleware/session/team.go b/router/middleware/session/team.go index c761d39b..f848564a 100644 --- a/router/middleware/session/team.go +++ b/router/middleware/session/team.go @@ -65,9 +65,9 @@ func MustTeamAdmin() gin.HandlerFunc { if perm.Admin { c.Next() + } else { + c.String(401, "User not authorized") + c.Abort() } - - c.String(401, "User not authorized") - c.Abort() } }