master
rob 2 years ago
parent c5120d4c8a
commit 50f26d0fb1

@ -330,6 +330,18 @@ class OAuth2Service extends SiteService {
return clients;
}
async getRandomClients (maxCount) {
const clients = await OAuth2Client.aggregate([
{
$match: { 'flags.isActive': true },
},
{
$sample: { size: maxCount },
}
]);
return clients;
}
async getClientById (clientId) {
const client = await OAuth2Client
.findOne({ _id: clientId })

Loading…
Cancel
Save