MCPcopy
hub / github.com/21st-dev/1code / encryptToken

Function encryptToken

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

* Encrypt token using Electron's safeStorage

(token: string)

Source from the content-addressed store, hash-verified

26 * Encrypt token using Electron's safeStorage
27 */
28function encryptToken(token: string): string {
29 if (!safeStorage.isEncryptionAvailable()) {
30 console.warn("[ClaudeCode] Encryption not available, storing as base64")
31 return Buffer.from(token).toString("base64")
32 }
33 return safeStorage.encryptString(token).toString("base64")
34}
35
36/**
37 * Decrypt token using Electron's safeStorage

Callers 1

storeOAuthTokenFunction · 0.70

Calls 1

isEncryptionAvailableMethod · 0.80

Tested by

no test coverage detected