Fix verification options in API

This commit is contained in:
Yarmo Mackenbach 2021-11-04 11:23:29 +01:00
parent 9eb4069253
commit 479b00fc8e
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -32,6 +32,7 @@ const { check, validationResult } = require('express-validator')
const Ajv = require("ajv")
const ajv = new Ajv({coerceTypes: true})
const kx = require('../../server')
require('dotenv').config()
const apiProfileSchema = {
type: "object",
@ -169,6 +170,12 @@ const apiProfileValidate = ajv.compile(apiProfileSchema)
const doVerification = async (data) => {
let promises = []
let results = []
let verificationOptions = {
proxy: {
hostname: process.env.PROXY_HOSTNAME,
policy: (process.env.PROXY_HOSTNAME != "") ? 'adaptive' : 'never'
}
}
for (let iUser = 0; iUser < data.keyData.users.length; iUser++) {
const user = data.keyData.users[iUser]
@ -178,7 +185,7 @@ const doVerification = async (data) => {
promises.push(
new Promise(async (resolve, reject) => {
await claim.verify()
await claim.verify(verificationOptions)
results.push([iUser, iClaim, claim])
resolve()
})