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 { authorization = '' } = req.headers
|
||||
|
||||
if (!isKeyTrusted) {
|
||||
logger.warn('Untrusted public key!')
|
||||
}
|
||||
|
||||
if (!walletUnlocked) {
|
||||
await unlockWallet(password)
|
||||
}
|
||||
|
|
@ -577,7 +581,8 @@ module.exports = async (
|
|||
if (walletUnlocked && !authorization && !isKeyTrusted) {
|
||||
res.status(401).json({
|
||||
field: 'alias',
|
||||
errorMessage: 'Invalid alias/password combination',
|
||||
errorMessage:
|
||||
'Invalid alias/password combination (Untrusted Device)',
|
||||
success: false
|
||||
})
|
||||
return
|
||||
|
|
@ -591,7 +596,8 @@ module.exports = async (
|
|||
if (!validatedToken) {
|
||||
res.status(401).json({
|
||||
field: 'alias',
|
||||
errorMessage: 'Invalid alias/password combination',
|
||||
errorMessage:
|
||||
'Invalid alias/password combination (Untrusted Auth Token)',
|
||||
success: false
|
||||
})
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue