package middleware import ( "net/http" "github.com/xlgmokha/x/pkg/x" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg" ) var IsLoggedIn x.Predicate[*http.Request] = x.Predicate[*http.Request](func(r *http.Request) bool { user := cfg.CurrentUser.From(r.Context()) return x.IsPresent(user) && x.IsPresent(user.ID) })