( session: BridgeEligibilitySession, )
| 98 | } |
| 99 | |
| 100 | export function getBridgeEligibilityPreGateReason( |
| 101 | session: BridgeEligibilitySession, |
| 102 | ): string | null { |
| 103 | if (!hasManagedBridgePrincipal(session)) { |
| 104 | return BRIDGE_MANAGED_ACCOUNT_REQUIRED_MESSAGE |
| 105 | } |
| 106 | if (!session.scopes.includes('user:profile')) { |
| 107 | return BRIDGE_FULL_SCOPE_REQUIRED_MESSAGE |
| 108 | } |
| 109 | if (!session.identity.organizationUuid) { |
| 110 | return BRIDGE_ORG_REQUIRED_MESSAGE |
| 111 | } |
| 112 | return null |
| 113 | } |
| 114 | |
| 115 | // try/catch: main.tsx calls isBridgeEnabled() while defining the Commander |
| 116 | // program, before configs are enabled. Resolve bridge-eligibility session |
no test coverage detected