* Decrypt token using Electron's safeStorage
(encrypted: string)
| 37 | * Decrypt token using Electron's safeStorage |
| 38 | */ |
| 39 | function 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 |
no test coverage detected