Add methods to get challengeMap

Update boot/challenge.js to use new methods
Update boot/user.js to use new methods
This commit is contained in:
Berkeley Martinez
2016-04-06 21:08:19 -07:00
parent 7737bfedc1
commit 1308d312a4
5 changed files with 132 additions and 97 deletions

View File

@@ -84,7 +84,8 @@ export default function certificate(app) {
function verifyCert(certType, req, res, next) {
const { user } = req;
return certTypeIds[certType]
return user.getChallengeMap()
.flatMap(() => certTypeIds[certType])
.flatMap(challenge => {
const {
id,