mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-26 17:51:13 +08:00
feat: allow onepanel-access-token in addition to the onepanel-auth-token
This commit is contained in:
2
main.go
2
main.go
@@ -288,6 +288,8 @@ func customHeaderMatcher(key string) (string, bool) {
|
||||
switch lowerCaseKey {
|
||||
case "onepanel-auth-token":
|
||||
return lowerCaseKey, true
|
||||
case "onepanel-access-token":
|
||||
return lowerCaseKey, true
|
||||
case "cookie":
|
||||
return lowerCaseKey, true
|
||||
default:
|
||||
|
@@ -66,6 +66,10 @@ func getBearerToken(ctx context.Context) (*string, bool) {
|
||||
return &t, true
|
||||
}
|
||||
|
||||
for _, t := range md.Get("onepanel-access-token") {
|
||||
return &t, true
|
||||
}
|
||||
|
||||
log.WithFields(log.Fields{
|
||||
"Method": "getBearerToken",
|
||||
}).Error("Unable to get BearerToken:", md)
|
||||
|
Reference in New Issue
Block a user