Skip to content

Commit c2ac309

Browse files
committed
util: Do not delete persisted credentials when memoryOnly is used
1 parent 4bf81b5 commit c2ac309

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/util/credentialStore.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,17 @@ export default class LncCredentialStore implements CredentialStore {
178178
if (!memoryOnly) {
179179
const key = `${STORAGE_KEY}:${this.namespace}`;
180180
localStorage.removeItem(key);
181+
182+
this.persisted = {
183+
salt: '',
184+
cipher: '',
185+
serverHost: this.persisted.serverHost,
186+
localKey: '',
187+
remoteKey: '',
188+
pairingPhrase: ''
189+
};
181190
}
182-
this.persisted = {
183-
salt: '',
184-
cipher: '',
185-
serverHost: this.persisted.serverHost,
186-
localKey: '',
187-
remoteKey: '',
188-
pairingPhrase: ''
189-
};
191+
190192
this._localKey = '';
191193
this._remoteKey = '';
192194
this._pairingPhrase = '';

0 commit comments

Comments
 (0)