package middleware import ( "net/http" ) func RequireUser() func(http.Handler) http.Handler { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if IsLoggedIn(r) { next.ServeHTTP(w, r) } else { // TODO:: https://gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/-/issues/1 w.WriteHeader(http.StatusNotFound) } }) } }