Simplify
This commit is contained in:
parent
0d71c14e22
commit
d6de81370b
1 changed files with 7 additions and 20 deletions
|
|
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue