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

Function validateAuthCode

freebuff/web/src/app/onboard/_helpers.ts:123–131  ·  view source on GitHub ↗
(
  receivedHash: string,
  fingerprintId: string,
  expiresAt: string,
  secret: string,
)

Source from the content-addressed store, hash-verified

121}
122
123export function validateAuthCode(
124 receivedHash: string,
125 fingerprintId: string,
126 expiresAt: string,
127 secret: string,
128): { valid: boolean; expectedHash: string } {
129 const expectedHash = genAuthCode(fingerprintId, expiresAt, secret)
130 return { valid: receivedHash === expectedHash, expectedHash }
131}
132
133export function isAuthCodeExpired(expiresAt: string): boolean {
134 const expiresAtMs = Number(expiresAt)

Callers 2

OnboardFunction · 0.90
helpers.test.tsFile · 0.90

Calls 1

genAuthCodeFunction · 0.90

Tested by

no test coverage detected