Merge pull request #15 from tbphp/fix-proxy-auth-check
fix: Proxy auth check
This commit is contained in:
@@ -136,11 +136,6 @@ func Auth(
|
|||||||
if strings.HasPrefix(path, "/api") {
|
if strings.HasPrefix(path, "/api") {
|
||||||
// Handle backend API authentication
|
// Handle backend API authentication
|
||||||
key = extractBearerKey(c)
|
key = extractBearerKey(c)
|
||||||
if key == "" || key != authConfig.Key {
|
|
||||||
response.Error(c, app_errors.ErrUnauthorized)
|
|
||||||
c.Abort()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else if strings.HasPrefix(path, "/proxy/") {
|
} else if strings.HasPrefix(path, "/proxy/") {
|
||||||
// Handle proxy authentication
|
// Handle proxy authentication
|
||||||
key, err = extractProxyKey(c, groupManager, channelFactory)
|
key, err = extractProxyKey(c, groupManager, channelFactory)
|
||||||
@@ -161,7 +156,7 @@ func Auth(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if key == "" {
|
if key == "" || key != authConfig.Key {
|
||||||
response.Error(c, app_errors.ErrUnauthorized)
|
response.Error(c, app_errors.ErrUnauthorized)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user