mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
fix(core): exclude demo connector for quota (#4245)
This commit is contained in:
parent
16d83dd2f1
commit
0aa00307cb
1 changed files with 7 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
import { ConnectorType } from '@logto/connector-kit';
|
||||
import { ConnectorType, DemoConnector } from '@logto/connector-kit';
|
||||
|
||||
import { EnvSet } from '#src/env-set/index.js';
|
||||
import RequestError from '#src/errors/RequestError/index.js';
|
||||
|
@ -55,12 +55,16 @@ export const createQuotaLibrary = (
|
|||
},
|
||||
socialConnectorsLimit: async () => {
|
||||
const connectors = await getLogtoConnectors();
|
||||
const count = connectors.filter(({ type }) => type === ConnectorType.Social).length;
|
||||
const count = connectors.filter(
|
||||
({ type, metadata: { id } }) => type === ConnectorType.Social && id !== DemoConnector.Social
|
||||
).length;
|
||||
return { count };
|
||||
},
|
||||
standardConnectorsLimit: async () => {
|
||||
const connectors = await getLogtoConnectors();
|
||||
const count = connectors.filter(({ metadata: { isStandard } }) => isStandard).length;
|
||||
const count = connectors.filter(
|
||||
({ metadata: { isStandard, id } }) => isStandard && id !== DemoConnector.Social
|
||||
).length;
|
||||
return { count };
|
||||
},
|
||||
customDomainEnabled: notNumber,
|
||||
|
|
Loading…
Reference in a new issue