Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created November 28, 2016 22:56
Show Gist options
  • Save ScullWM/90bfc753b9b337285084c20653c35fad to your computer and use it in GitHub Desktop.
Save ScullWM/90bfc753b9b337285084c20653c35fad to your computer and use it in GitHub Desktop.
func checkAuth(h http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if ReadCookieHandler(r) {
h.ServeHTTP(w, r)
} else {
log.Printf("Not authorized %s", 401)
}
h.ServeHTTP(w, r)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment