Merge pull request #198 from shocknet/bug/auth_issues
More descriptive error messages
This commit is contained in:
commit
3f5ca53c0d
1 changed files with 8 additions and 2 deletions
|
|
@ -570,6 +570,10 @@ module.exports = async (
|
||||||
const walletUnlocked = health.LNDStatus.walletStatus === 'unlocked'
|
const walletUnlocked = health.LNDStatus.walletStatus === 'unlocked'
|
||||||
const { authorization = '' } = req.headers
|
const { authorization = '' } = req.headers
|
||||||
|
|
||||||
|
if (!isKeyTrusted) {
|
||||||
|
logger.warn('Untrusted public key!')
|
||||||
|
}
|
||||||
|
|
||||||
if (!walletUnlocked) {
|
if (!walletUnlocked) {
|
||||||
await unlockWallet(password)
|
await unlockWallet(password)
|
||||||
}
|
}
|
||||||
|
|
@ -577,7 +581,8 @@ module.exports = async (
|
||||||
if (walletUnlocked && !authorization && !isKeyTrusted) {
|
if (walletUnlocked && !authorization && !isKeyTrusted) {
|
||||||
res.status(401).json({
|
res.status(401).json({
|
||||||
field: 'alias',
|
field: 'alias',
|
||||||
errorMessage: 'Invalid alias/password combination',
|
errorMessage:
|
||||||
|
'Invalid alias/password combination (Untrusted Device)',
|
||||||
success: false
|
success: false
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
@ -591,7 +596,8 @@ module.exports = async (
|
||||||
if (!validatedToken) {
|
if (!validatedToken) {
|
||||||
res.status(401).json({
|
res.status(401).json({
|
||||||
field: 'alias',
|
field: 'alias',
|
||||||
errorMessage: 'Invalid alias/password combination',
|
errorMessage:
|
||||||
|
'Invalid alias/password combination (Untrusted Auth Token)',
|
||||||
success: false
|
success: false
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue