diff --git a/go.mod b/go.mod index 4d701b0..e49b5f9 100644 Binary files a/go.mod and b/go.mod differ diff --git a/main.go b/main.go index 7248719..8fdf221 100644 --- a/main.go +++ b/main.go @@ -68,6 +68,7 @@ type VerifyResponse struct { Valid bool `json:"valid"` RedirectURL *string `json:"redirectUrl"` UserId *string `json:"userId,omitempty"` + DontStripSession bool `json:"dontStripSession,omitempty"` Username *string `json:"username,omitempty"` Email *string `json:"email,omitempty"` Name *string `json:"name,omitempty"` @@ -327,9 +328,11 @@ func (p *Badger) ServeHTTP(rw http.ResponseWriter, req *http.Request) { req.Header.Add("Remote-Role", *result.Data.Role) } - p.stripSessionCookies(req) - p.stripSessionParam(req) - p.stripAccessTokenHeaders(req) + if !result.Data.DontStripSession { + p.stripSessionParam(req) + p.stripSessionCookies(req) + p.stripAccessTokenHeaders(req) + } fmt.Println("Badger: Valid session") p.next.ServeHTTP(rw, req)