(secret: string)
| 63 | } |
| 64 | |
| 65 | function encodeSecret(secret: string): string | null { |
| 66 | if (!safeStorage.isEncryptionAvailable()) { |
| 67 | if (!warnedAboutMissingSecureStorage) { |
| 68 | warnedAboutMissingSecureStorage = true |
| 69 | console.warn( |
| 70 | 'ZenNotes could not persist a remote workspace token securely because no OS secret store is available.' |
| 71 | ) |
| 72 | } |
| 73 | return null |
| 74 | } |
| 75 | if (!warnedAboutFallback) { |
| 76 | warnedAboutFallback = true |
| 77 | console.warn('ZenNotes is using Electron safeStorage as the fallback remote credential store.') |
| 78 | } |
| 79 | return safeStorage.encryptString(secret).toString('base64') |
| 80 | } |
| 81 | |
| 82 | function decodeSecret(encoded: string): string | null { |
| 83 | if (!safeStorage.isEncryptionAvailable()) return null |
no outgoing calls
no test coverage detected