Fix for an issue detected by user test case.

This commit is contained in:
mike12345567 2020-10-02 12:52:15 +01:00
parent 0db7768e5d
commit 60cb080189
1 changed files with 2 additions and 1 deletions

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