fix: return unauthenticated code (#6819)

* fix: return unauthenticated code

* remove cfg.yaml

---------

Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
Elio Bischof
2023-10-27 06:09:07 +00:00
committed by GitHub
co-authored by Livio Spring
parent 0187487f26
commit a4626f9bdb
12 changed files with 12 additions and 2 deletions
+1 -2
View File
@@ -109,9 +109,8 @@ func VerifyTokenAndCreateCtxData(ctx context.Context, token, orgID, orgDomain st
if err != nil {
var sysTokenErr error
sysMemberships, userID, sysTokenErr = t.VerifySystemToken(ctx, tokenWOBearer, orgID)
err = errors.Join(err, sysTokenErr)
if sysTokenErr != nil || sysMemberships == nil {
return CtxData{}, err
return CtxData{}, zitadel_errors.ThrowUnauthenticated(errors.Join(err, sysTokenErr), "AUTH-7fs1e", "Errors.Token.Invalid")
}
}
var projectID string