(w http.ResponseWriter)
| 10 | const AuthUserID = "middleware.auth.userID" |
| 11 | |
| 12 | func writeUnauthed(w http.ResponseWriter) { |
| 13 | w.WriteHeader(http.StatusUnauthorized) |
| 14 | w.Write([]byte(http.StatusText(http.StatusUnauthorized))) |
| 15 | } |
| 16 | |
| 17 | func IsAuthenticated(next http.Handler) http.Handler { |
| 18 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
no test coverage detected