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

Function resolveBuddyReactionSession

src/buddy/buddySession.ts:17–34  ·  view source on GitHub ↗
(
  session: BuddyReactionSessionInput,
)

Source from the content-addressed store, hash-verified

15}
16
17export function resolveBuddyReactionSession(
18 session: BuddyReactionSessionInput,
19): BuddyReactionSession | null {
20 if (
21 session?.principalSource !== 'managed_oauth' ||
22 session.providerPlan.mode !== 'noumena_managed' ||
23 session.headersKind !== 'bearer' ||
24 !session.accessToken ||
25 !session.identity.organizationUuid
26 ) {
27 return null
28 }
29
30 return {
31 accessToken: session.accessToken,
32 organizationUuid: session.identity.organizationUuid,
33 }
34}
35
36export function getCurrentBuddyReactionSession(): BuddyReactionSession | null {
37 return resolveBuddyReactionSession(getAuthRuntime().getCurrentSession())

Callers 3

postBuddyReactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected