diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-22 03:52:30 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-22 03:52:30 -0700 |
commit | 45e3a4fa9d946b42a5878733e043519ff88b19ea (patch) | |
tree | a428a04ae1e404a82af980bfe7c7dc3b6af34ae6 /system/admin/user/auth.go | |
parent | a4b2180e32b72729c27614dd3f10fd0da1f42fde (diff) |
debugging auth middleware
Diffstat (limited to 'system/admin/user/auth.go')
-rw-r--r-- | system/admin/user/auth.go | 3 |
1 files changed, 3 insertions, 0 deletions
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) } }) |