The AuthOnly path also needs the response headers set

This commit is contained in:
Adam Eijdenberg 2019-06-07 14:25:12 +10:00
parent 9e59b4f62e
commit f35c82bb0f

View File

@ -645,9 +645,11 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) {
// AuthenticateOnly checks whether the user is currently logged in // AuthenticateOnly checks whether the user is currently logged in
func (p *OAuthProxy) AuthenticateOnly(rw http.ResponseWriter, req *http.Request) { func (p *OAuthProxy) AuthenticateOnly(rw http.ResponseWriter, req *http.Request) {
_, err := p.getAuthenticatedSession(rw, req) session, err := p.getAuthenticatedSession(rw, req)
switch err { switch err {
case nil: case nil:
// we are authenticated
p.addHeadersForProxying(rw, req, session)
rw.WriteHeader(http.StatusAccepted) rw.WriteHeader(http.StatusAccepted)
default: default:
http.Error(rw, "unauthorized request", http.StatusUnauthorized) http.Error(rw, "unauthorized request", http.StatusUnauthorized)