@clerk/shared
Version:
Internal package utils used by the Clerk SDKs
1 lines • 1.11 kB
Source Map (JSON)
{"version":3,"file":"enterpriseSSOFactors.mjs","names":[],"sources":["../../../src/internal/clerk-js/enterpriseSSOFactors.ts"],"sourcesContent":["import type { EnterpriseSSOFactor, SignInFirstFactor } from '../../types';\n\ntype EnterpriseConnectionFactor = EnterpriseSSOFactor & {\n enterpriseConnectionId: string;\n enterpriseConnectionName: string;\n};\n\nexport function getEnterpriseConnectionFactors(\n factors: SignInFirstFactor[] | null | undefined,\n): EnterpriseConnectionFactor[] {\n return (factors ?? []).filter(\n (factor): factor is EnterpriseConnectionFactor =>\n factor.strategy === 'enterprise_sso' &&\n 'enterpriseConnectionId' in factor &&\n 'enterpriseConnectionName' in factor,\n );\n}\n\nexport function hasMultipleEnterpriseConnections(factors: SignInFirstFactor[] | null | undefined): boolean {\n return getEnterpriseConnectionFactors(factors).length > 1;\n}\n"],"mappings":";AAOA,SAAgB,+BACd,SAC8B;CAC9B,QAAQ,WAAW,CAAC,EAAC,CAAE,QACpB,WACC,OAAO,aAAa,oBACpB,4BAA4B,UAC5B,8BAA8B,MAClC;AACF;AAEA,SAAgB,iCAAiC,SAA0D;CACzG,OAAO,+BAA+B,OAAO,CAAC,CAAC,SAAS;AAC1D"}