feat: utilities section (wip) + auth utilities

This commit is contained in:
Nick
2019-06-30 15:18:26 -04:00
parent 9cd8657ce6
commit 604941fe6a
15 changed files with 496 additions and 184 deletions

View File

@@ -336,7 +336,7 @@ module.exports = class User extends Model {
static async loginTFA(opts, context) {
if (opts.securityCode.length === 6 && opts.loginToken.length === 64) {
let result = null // await WIKI.redis.get(`tfa:${opts.loginToken}`)
let result = await WIKI.redis.get(`tfa:${opts.loginToken}`)
if (result) {
let userId = _.toSafeInteger(result)
if (userId && userId > 0) {