refactor: privileged actions

This commit is contained in:
Sérgio Salgado 2021-04-19 23:59:21 +01:00 committed by Josh Harvey
parent 357fe75427
commit 7680b2f85a
5 changed files with 29 additions and 78 deletions

View file

@ -6,7 +6,7 @@ function validateUser (username, password) {
const q2 = t.none('UPDATE users SET last_accessed = now() WHERE username=$1', [username])
return t.batch([q1, q2])
.then(([user, _]) => user)
.then(([user]) => user)
.catch(() => false)
})
}