Skip to content
Snippets Groups Projects
Commit 0c9656a1 authored by Ewen Le Bihan's avatar Ewen Le Bihan
Browse files

fix(oauth): compute userCounts properly

parent bcdec830
Branches
Tags v1.40.2
No related merge requests found
......@@ -70,8 +70,7 @@ export const ThirdPartyApp = builder.prismaObject('ThirdPartyApp', {
}),
usersCount: t.int({
async resolve({ id }) {
return new Set(
await prisma.thirdPartyCredential.findMany({
const tokens = await prisma.thirdPartyCredential.findMany({
where: {
clientId: id,
type: ThirdPartyCredentialType.AccessToken,
......@@ -80,8 +79,8 @@ export const ThirdPartyApp = builder.prismaObject('ThirdPartyApp', {
select: {
ownerId: true,
},
}),
).size;
});
return new Set(tokens.map((token) => token.ownerId)).size;
},
}),
description: t.exposeString('description'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment