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

Function canUseGroveForSession

src/services/api/grove.ts:51–62  ·  view source on GitHub ↗
(
  session:
    | Pick<ResolvedAuthSession, 'identity' | 'principalSource' | 'subscription'>
    | null
    | undefined,
)

Source from the content-addressed store, hash-verified

49}
50
51export function canUseGroveForSession(
52 session:
53 | Pick<ResolvedAuthSession, 'identity' | 'principalSource' | 'subscription'>
54 | null
55 | undefined,
56): boolean {
57 return (
58 session?.principalSource === 'managed_oauth' &&
59 hasConsumerSubscription(session.subscription.subscriptionType) &&
60 Boolean(session.identity.accountUuid)
61 )
62}
63
64/**
65 * Get the current Grove settings for the user account.

Callers 2

isQualifiedForGroveFunction · 0.85
grove.test.tsFile · 0.85

Calls 1

hasConsumerSubscriptionFunction · 0.85

Tested by

no test coverage detected