MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / createKey

Method createKey

apps/web/services/api-keys.ts:12–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 }
11
12 private static createKey() {
13 const token = randomBytes(64).toString('hex');
14 const hash = createHash('sha256')
15 .update(`${token}${process.env.NEXTAUTH_SECRET}`)
16 .digest('hex');
17 return { token, hash };
18 }
19
20 static async getAccountByApiKey({ apiKey }: { apiKey: string }) {
21 const hash = this.decryptKey({ token: apiKey });

Callers 1

createMethod · 0.95

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected