MCPcopy Create free account
hub / github.com/Noumena-Network/code / getBridgeEligibilityPreGateReason

Function getBridgeEligibilityPreGateReason

src/bridge/bridgeEnabled.ts:100–113  ·  view source on GitHub ↗
(
  session: BridgeEligibilitySession,
)

Source from the content-addressed store, hash-verified

98}
99
100export 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

Callers 2

getBridgeDisabledReasonFunction · 0.85

Calls 1

Tested by

no test coverage detected