spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / telemetry / hooks / entries / event-data-of / auth-of / auth-of.ts
21 lines · 588 BRaw
1import type { Context } from '../../../context'
2
3/**
4 * The row's `auth`: the signed-in account's and organization's ids, or
5 * undefined when the identity holds neither (an API key, no login).
6 *
7 * @param identity who the rows are from
8 * @returns the ids, or undefined
9 */
10export function authOf(identity: Context['identity']) {
11 const hasEither =
12 identity.accountUuid !== undefined ||
13 identity.organizationUuid !== undefined
14
15 return hasEither
16 ? {
17 accountUuid: identity.accountUuid,
18 organizationUuid: identity.organizationUuid,
19 }
20 : undefined
21}