git.iko.soy/typeable/oauth2-proxy
on master help sign in
The AuthOnly path also needs the response headers set
commitf35c82bb0f7bb3877f7e60e6c2c62c5d1c7f9c99 authorAdam Eijdenberg <adam.eijdenberg@digital.gov.au> dateFri 7 Jun 2019, 14:25 (7 years ago) parent9e59b4f
1 file changed+3−1
oauthproxy.go+3−1
oauthproxy.go+3−1
@@ -645,9 +645,11 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) {
645645
646646// AuthenticateOnly checks whether the user is currently logged in
647647func (p *OAuthProxy) AuthenticateOnly(rw http.ResponseWriter, req *http.Request) {
648− _, err := p.getAuthenticatedSession(rw, req)
648+ session, err := p.getAuthenticatedSession(rw, req)
649649 switch err {
650650 case nil:
651+ // we are authenticated
652+ p.addHeadersForProxying(rw, req, session)
651653 rw.WriteHeader(http.StatusAccepted)
652654 default:
653655 http.Error(rw, "unauthorized request", http.StatusUnauthorized)