blob: f70a03b514387280ea5aee4331df8c8c7d7a88b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
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)
})
|