refactor(middleware): remove RequireGlobalAuth wrapper

This commit is contained in:
2026-04-20 01:42:12 +02:00
parent f2554152fa
commit bbf208b4bf
2 changed files with 1 additions and 5 deletions

View File

@@ -55,10 +55,6 @@ func RequireAuth(next http.Handler) http.Handler {
})
}
func RequireGlobalAuth(next http.Handler) http.Handler {
return RequireGlobalAuthWithPolicy(NewAccessPolicy())(next)
}
func GetUser(ctx context.Context) *database.User {
user, ok := ctx.Value(UserContextKey).(*database.User)
if !ok {

View File

@@ -51,7 +51,7 @@ func TestRequireAuth_AuthenticatedRequestPassesThrough(t *testing.T) {
func TestRequireGlobalAuth_AllowsPublicRoute(t *testing.T) {
t.Parallel()
h := RequireGlobalAuth(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
h := RequireGlobalAuthWithPolicy(NewAccessPolicy())(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}))