MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / hasCliSessionForAuthHash

Function hasCliSessionForAuthHash

freebuff/web/src/app/onboard/_db.ts:22–40  ·  view source on GitHub ↗
(
  fingerprintHash: string,
  userId: string,
)

Source from the content-addressed store, hash-verified

20 : never
21
22export async function hasCliSessionForAuthHash(
23 fingerprintHash: string,
24 userId: string,
25): Promise<boolean> {
26 const existing = await db
27 .select({ id: schema.session.userId })
28 .from(schema.session)
29 .where(
30 and(
31 eq(schema.session.cli_auth_hash, fingerprintHash),
32 eq(schema.session.userId, userId),
33 eq(schema.session.type, 'cli'),
34 gt(schema.session.expires, new Date()),
35 ),
36 )
37 .limit(1)
38
39 return existing.length > 0
40}
41
42export async function consumeCliAuthCodeToken(
43 authCodeToken: string,

Callers 1

OnboardFunction · 0.90

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected