MCPcopy Index your code
hub / github.com/21st-dev/1code / decryptToken

Function decryptToken

src/main/lib/trpc/routers/claude-code.ts:39–45  ·  view source on GitHub ↗

* Decrypt token using Electron's safeStorage

(encrypted: string)

Source from the content-addressed store, hash-verified

37 * Decrypt token using Electron's safeStorage
38 */
39function decryptToken(encrypted: string): string {
40 if (!safeStorage.isEncryptionAvailable()) {
41 return Buffer.from(encrypted, "base64").toString("utf-8")
42 }
43 const buffer = Buffer.from(encrypted, "base64")
44 return safeStorage.decryptString(buffer)
45}
46
47/**
48 * Store OAuth token - now uses multi-account system

Callers 1

claude-code.tsFile · 0.70

Calls 1

isEncryptionAvailableMethod · 0.80

Tested by

no test coverage detected