From 0d71c14e2202d7dc0f7fac24b2dabdc473db8fff Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Sun, 26 Dec 2021 16:13:32 -0400 Subject: [PATCH] Remove old access code stuff --- src/routes.js | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/routes.js b/src/routes.js index ef191563..11baa06f 100644 --- a/src/routes.js +++ b/src/routes.js @@ -602,7 +602,7 @@ module.exports = async ( try { const health = await checkHealth() const walletInitialized = await walletExists() - const { alias, password, invite, accessSecret } = req.body + const { alias, password } = req.body const lndUp = health.LNDStatus.success const trustedKeysEnabled = process.env.TRUSTED_KEYS === 'true' || !process.env.TRUSTED_KEYS @@ -648,17 +648,12 @@ module.exports = async ( if (!walletUnlocked) { await unlockWallet(password) } - let secretUsed = null - if (accessSecret) { - secretUsed = await Storage.get( - `UnlockedAccessSecrets/${accessSecret}` - ) - } + if ( walletUnlocked && !authorization && !isKeyTrusted && - (!allowUnlockedLND || secretUsed !== false) + !allowUnlockedLND ) { res.status(401).json({ field: 'alias', @@ -669,11 +664,7 @@ module.exports = async ( return } - if ( - walletUnlocked && - !isKeyTrusted && - (!allowUnlockedLND || secretUsed !== false) - ) { + if (walletUnlocked && !isKeyTrusted && !allowUnlockedLND) { const validatedToken = await validateToken( authorization.replace('Bearer ', '') ) @@ -689,10 +680,6 @@ module.exports = async ( } } - if (secretUsed === false) { - await Storage.setItem(`UnlockedAccessSecrets/${accessSecret}`, true) - } - if (!isKeyTrusted) { await Storage.set('trustedPKs', [...(trustedKeys || []), publicKey]) }