1
0
Fork 0
mirror of synced 2024-06-30 03:50:37 +12:00

Fix for an issue detected by user test case.

This commit is contained in:
mike12345567 2020-10-02 12:52:15 +01:00
parent 2aff68b245
commit d4c3200322

View file

@ -2,6 +2,7 @@ const jwt = require("jsonwebtoken")
const CouchDB = require("../../db")
const ClientDb = require("../../db/clientDb")
const bcrypt = require("../../utilities/bcrypt")
const { generateUserID } = require("../../db/utils")
exports.authenticate = async ctx => {
if (!ctx.user.appId) ctx.throw(400, "No appId")
@ -35,7 +36,7 @@ exports.authenticate = async ctx => {
let dbUser
try {
dbUser = await instanceDb.get(`user_${username}`)
dbUser = await instanceDb.get(generateUserID(username))
} catch (_) {
// do not want to throw a 404 - as this could be
// used to dtermine valid usernames