MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / encodeSecret

Function encodeSecret

apps/desktop/src/main/secret-store.ts:65–80  ·  view source on GitHub ↗
(secret: string)

Source from the content-addressed store, hash-verified

63}
64
65function 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
82function decodeSecret(encoded: string): string | null {
83 if (!safeStorage.isEncryptionAvailable()) return null

Callers 1

setRemoteWorkspaceSecretFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected