From 0db179c31298ba5c7704095b0d6ed66cd92277dc Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Mon, 18 Dec 2023 08:21:56 -0800 Subject: [PATCH] fix: uses username instead of email to validate remote user proxy. see #2598 (#2604) --- internal/auth/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/proxy.go b/internal/auth/proxy.go index 75ec4278..a34d55f8 100644 --- a/internal/auth/proxy.go +++ b/internal/auth/proxy.go @@ -31,7 +31,7 @@ func NewForwardProxyAuth() *proxyAuthContext { func (p *proxyAuthContext) AuthMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.Header.Get("Remote-Email") != "" { + if r.Header.Get("Remote-User") != "" { user := newUser(r.Header.Get("Remote-User"), r.Header.Get("Remote-Email"), r.Header.Get("Remote-Name")) ctx := context.WithValue(r.Context(), remoteUser, user) next.ServeHTTP(w, r.WithContext(ctx))