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

Function validateAuthCode

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

Source from the content-addressed store, hash-verified

142}
143
144export function validateAuthCode(
145 receivedHash: string,
146 fingerprintId: string,
147 expiresAt: string,
148 secret: string,
149): { valid: boolean; expectedHash: string } {
150 const expectedHash = genAuthCode(fingerprintId, expiresAt, secret)
151 return { valid: receivedHash === expectedHash, expectedHash }
152}
153
154export function isAuthCodeExpired(expiresAt: string): boolean {
155 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