mirror of
https://github.com/fosrl/badger.git
synced 2026-10-29 15:09:10 +01:00
Dont strip session
This commit is contained in:
@@ -68,6 +68,7 @@ type VerifyResponse struct {
|
|||||||
Valid bool `json:"valid"`
|
Valid bool `json:"valid"`
|
||||||
RedirectURL *string `json:"redirectUrl"`
|
RedirectURL *string `json:"redirectUrl"`
|
||||||
UserId *string `json:"userId,omitempty"`
|
UserId *string `json:"userId,omitempty"`
|
||||||
|
DontStripSession bool `json:"dontStripSession,omitempty"`
|
||||||
Username *string `json:"username,omitempty"`
|
Username *string `json:"username,omitempty"`
|
||||||
Email *string `json:"email,omitempty"`
|
Email *string `json:"email,omitempty"`
|
||||||
Name *string `json:"name,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)
|
req.Header.Add("Remote-Role", *result.Data.Role)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.stripSessionCookies(req)
|
if !result.Data.DontStripSession {
|
||||||
p.stripSessionParam(req)
|
p.stripSessionParam(req)
|
||||||
p.stripAccessTokenHeaders(req)
|
p.stripSessionCookies(req)
|
||||||
|
p.stripAccessTokenHeaders(req)
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Println("Badger: Valid session")
|
fmt.Println("Badger: Valid session")
|
||||||
p.next.ServeHTTP(rw, req)
|
p.next.ServeHTTP(rw, req)
|
||||||
|
|||||||
Reference in New Issue
Block a user