From 45e3a4fa9d946b42a5878733e043519ff88b19ea Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 22 Oct 2016 03:52:30 -0700 Subject: debugging auth middleware --- system/admin/user/auth.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'system') diff --git a/system/admin/user/auth.go b/system/admin/user/auth.go index 3ff2b2b..5a2965d 100644 --- a/system/admin/user/auth.go +++ b/system/admin/user/auth.go @@ -2,6 +2,7 @@ package user import ( "encoding/base64" + "fmt" "net/http" "github.com/nilslice/jwt" @@ -37,8 +38,10 @@ func Auth(next http.HandlerFunc) http.HandlerFunc { redir := req.URL.Scheme + req.URL.Host + "/admin/login" if IsValid(req) { + fmt.Println("valid") next.ServeHTTP(res, req) } else { + fmt.Println("invalid") http.Redirect(res, req, redir, http.StatusFound) } }) -- cgit v1.2.3