mirror of
https://github.com/fosrl/badger.git
synced 2026-02-07 21:46:43 +00:00
role in headers
This commit is contained in:
5
main.go
5
main.go
@@ -43,6 +43,7 @@ type VerifyResponse struct {
|
||||
Username *string `json:"username,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Role *string `json:"role,omitempty"`
|
||||
ResponseHeaders map[string]string `json:"responseHeaders,omitempty"`
|
||||
} `json:"data"`
|
||||
}
|
||||
@@ -220,6 +221,10 @@ func (p *Badger) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
req.Header.Add("Remote-Name", *result.Data.Name)
|
||||
}
|
||||
|
||||
if result.Data.Role != nil {
|
||||
req.Header.Add("Remote-Role", *result.Data.Role)
|
||||
}
|
||||
|
||||
fmt.Println("Badger: Valid session")
|
||||
p.next.ServeHTTP(rw, req)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user