fix: invalid json response when login gate is disabled

This commit is contained in:
Gabe Farrell 2026-01-26 14:44:07 -05:00
parent 42b32c7920
commit 2356e75a3b
2 changed files with 16 additions and 4 deletions

View file

@ -62,6 +62,7 @@ func Authenticate(store db.DB, mode AuthMode) func(http.Handler) http.Handler {
}
} else {
next.ServeHTTP(w, r)
return
}
}
@ -76,10 +77,8 @@ func Authenticate(store db.DB, mode AuthMode) func(http.Handler) http.Handler {
return
}
if user != nil {
ctx = context.WithValue(ctx, UserContextKey, user)
r = r.WithContext(ctx)
}
ctx = context.WithValue(ctx, UserContextKey, user)
r = r.WithContext(ctx)
next.ServeHTTP(w, r)
})