func authHandler(h http.Handler, tokenizer Tokenizer, log log.Logger) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case "/user_create", "/user_login":
			// [unauthenticated]
		default:
			if err := checkTokenUsername(r, tokenizer); err != nil {
				log.Printf(err.Error())
				httpError(w, http.StatusForbidden)
				return
			}
		}
		h.ServeHTTP(w, r)
	}
}
// authHandler checks the token username of the request before running the child handler
authHandler checks the token username of the request before running the child handler
// authHandler checks the token username of the request before running the child handler
func authHandler(h http.Handler, tokenizer Tokenizer, log log.Logger) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		switch r.URL.Path {
		case "/user_create", "/user_login":
		default:
			if err := checkTokenUsername(r, tokenizer); err != nil {
				log.Printf(err.Error())
				httpError(w, http.StatusForbidden)
				return
			}
		}
		h.ServeHTTP(w, r)
	}
}
func authHandler ( h http . Handler , tokenizer Tokenizer , log log . Logger ) http . HandlerFunc { return func ( w http . ResponseWriter , r * http . Request ) { switch r . URL . Path { case " " , " " : default : if err := checkTokenUsername ( r , tokenizer ) ; err != nil { log . Printf ( err . Error ( ) ) httpError ( w , http . StatusForbidden ) return } } h . ServeHTTP ( w , r ) } }
authHandler checks the token username of the request before running the child handler
authHandler checks the token username of the request before running the child handler
// [unauthenticated]