Skip to content

Commit e9fc9a4

Browse files
authored
fix(tokens): revoke ambiguous API tokens (#2195)
Signed-off-by: Miguel Martinez <[email protected]>
1 parent 86ae009 commit e9fc9a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/controlplane/pkg/data/apitoken.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ func (r *APITokenRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, nam
7676

7777
if projectID != nil {
7878
query = query.Where(apitoken.ProjectIDEQ(*projectID))
79+
} else {
80+
query = query.Where(apitoken.ProjectIDIsNil())
7981
}
8082

8183
token, err := query.Only(ctx)

0 commit comments

Comments
 (0)