mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: keystone panic on invalid auth token
This commit is contained in:
@@ -179,7 +179,7 @@ func verifyTokensV3(ctx context.Context, w http.ResponseWriter, r *http.Request)
|
||||
|
||||
func verifyCommon(ctx context.Context, w http.ResponseWriter, tokenStr string) (*SAuthToken, error) {
|
||||
adminToken := policy.FetchUserCredential(ctx)
|
||||
if !adminToken.IsAllow(rbacutils.ScopeSystem, api.SERVICE_TYPE, "tokens", "perform", "auth") {
|
||||
if adminToken == nil || !adminToken.IsAllow(rbacutils.ScopeSystem, api.SERVICE_TYPE, "tokens", "perform", "auth") {
|
||||
return nil, httperrors.NewForbiddenError("not allow to auth")
|
||||
}
|
||||
token := SAuthToken{}
|
||||
|
||||
Reference in New Issue
Block a user