fix challengeCallbacks
This commit is contained in:
parent
e91c4a9e9c
commit
e6b3ef7d52
2 changed files with 6 additions and 5 deletions
|
|
@ -40,7 +40,7 @@ class Client {
|
|||
/** @type {import('crypto').KeyObject} */
|
||||
this.accountPublicKey = null
|
||||
this.directoryUrl = directoryUrl
|
||||
this.challengeCallbacks = {}
|
||||
this.challengeCallbacks = null
|
||||
this.hasDirectory = false
|
||||
this.myAccountUrl = ''
|
||||
this.newAccountUrl = ''
|
||||
|
|
@ -236,7 +236,7 @@ class Client {
|
|||
const clientKey = common.exportPrivateKey(privateKey)
|
||||
let {
|
||||
csr
|
||||
// @ts-ignore
|
||||
// @ts-ignore
|
||||
} = await createCsr({
|
||||
clientKey,
|
||||
commonName: domain,
|
||||
|
|
@ -438,13 +438,14 @@ class Client {
|
|||
reject(new Error('Timed out waiting for server request'))
|
||||
}, 10e3);
|
||||
let hasResolved = false;
|
||||
this.challengeCallbacks[domain] = function () {
|
||||
this.challengeCallbacks = () => {
|
||||
if (!hasResolved)
|
||||
setTimeout(resolve, 100);
|
||||
else
|
||||
return challenge.token + '.' + this.thumbprint;
|
||||
hasResolved = true;
|
||||
clearTimeout(time);
|
||||
this.challengeCallbacks = null;
|
||||
return challenge.token + '.' + this.thumbprint;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue