This commit is contained in:
Daniel Lugo 2021-12-26 16:53:57 -04:00
parent 0d71c14e22
commit d6de81370b

View file

@ -629,12 +629,7 @@ module.exports = async (
const publicKey = await GunDB.authenticate(alias, password) const publicKey = await GunDB.authenticate(alias, password)
if (!publicKey) { if (!publicKey) {
res.status(401).json({ throw new Error('Invalid alias/password combination')
field: 'alias',
errorMessage: 'Invalid alias/password combination',
success: false
})
return false
} }
const [isKeyTrusted = !trustedKeysEnabled] = (trustedKeys || []).filter( const [isKeyTrusted = !trustedKeysEnabled] = (trustedKeys || []).filter(
@ -655,13 +650,9 @@ module.exports = async (
!isKeyTrusted && !isKeyTrusted &&
!allowUnlockedLND !allowUnlockedLND
) { ) {
res.status(401).json({ throw new Error(
field: 'alias', 'Invalid alias/password combination (Untrusted Device)'
errorMessage: )
'Invalid alias/password combination (Untrusted Device)',
success: false
})
return
} }
if (walletUnlocked && !isKeyTrusted && !allowUnlockedLND) { if (walletUnlocked && !isKeyTrusted && !allowUnlockedLND) {
@ -670,13 +661,9 @@ module.exports = async (
) )
if (!validatedToken) { if (!validatedToken) {
res.status(401).json({ throw new Error(
field: 'alias', 'Invalid alias/password combination (Untrusted Auth Token)'
errorMessage: )
'Invalid alias/password combination (Untrusted Auth Token)',
success: false
})
return
} }
} }