MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / generateOAuthToken

Function generateOAuthToken

packages/shared/src/crypto.ts:59–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57}
58
59export function generateOAuthToken(): { token: string; hash: string } {
60 const secret = crypto.randomBytes(32).toString('hex');
61 const hash = hashSecret(secret);
62
63 return {
64 token: `${OAUTH_ACCESS_TOKEN_PREFIX}${secret}`,
65 hash,
66 };
67}
68
69export function generateOAuthRefreshToken(): { token: string; hash: string } {
70 const secret = crypto.randomBytes(32).toString('hex');

Callers 2

verifyAndExchangeCodeFunction · 0.90

Calls 1

hashSecretFunction · 0.85

Tested by

no test coverage detected