MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / generateState

Function generateState

packages/cli/src/auth/pkce.ts:37–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36/** OAuth `state` parameter — a CSRF token bound to this flow. */
37export function generateState(): string {
38 return base64UrlEncode(randomBytes(32));
39}
40
41function base64UrlEncode(buf: Buffer): string {
42 return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");

Callers 2

pkce.test.tsFile · 0.85

Calls 1

base64UrlEncodeFunction · 0.85

Tested by

no test coverage detected