changeset 1319:450f5d0f5fe7

Cosmetics.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 24 Nov 2018 16:29:22 +0100
parents 50dd4ff7907e
children fbdd7c3cfeac
files pkg/auth/middleware.go
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/auth/middleware.go	Sat Nov 24 16:22:28 2018 +0100
+++ b/pkg/auth/middleware.go	Sat Nov 24 16:29:22 2018 +0100
@@ -65,8 +65,7 @@
 
 func SessionChecker(next http.Handler, check func(*Session) bool) http.Handler {
 	return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
-		claims, ok := GetSession(req)
-		if !ok || !check(claims) {
+		if claims, ok := GetSession(req); !ok || !check(claims) {
 			http.Error(rw, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)
 			return
 		}