working, huzzah!
This commit is contained in:
parent
fd04a5070b
commit
fd62408a9a
|
@ -214,6 +214,7 @@ C._check = function(db, args) {
|
||||||
certificate: args.certificate
|
certificate: args.certificate
|
||||||
};
|
};
|
||||||
return db.check(query).then(function(pems) {
|
return db.check(query).then(function(pems) {
|
||||||
|
console.log('[debug] has pems? (yes)', pems);
|
||||||
if (!pems) {
|
if (!pems) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -234,6 +235,7 @@ C._check = function(db, args) {
|
||||||
|
|
||||||
return U._getKeypair(db, args.subject, query)
|
return U._getKeypair(db, args.subject, query)
|
||||||
.then(function(keypair) {
|
.then(function(keypair) {
|
||||||
|
console.log('[debug get keypair]', Object.keys(keypair));
|
||||||
pems.privkey = keypair.privateKeyPem;
|
pems.privkey = keypair.privateKeyPem;
|
||||||
return pems;
|
return pems;
|
||||||
})
|
})
|
||||||
|
|
|
@ -310,7 +310,14 @@ G.create = function(gconf) {
|
||||||
challenges,
|
challenges,
|
||||||
account,
|
account,
|
||||||
args
|
args
|
||||||
);
|
).then(function(pems) {
|
||||||
|
if (!pems.privkey) {
|
||||||
|
throw new Error(
|
||||||
|
'missing private key, which is kinda important'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return pems;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
4
utils.js
4
utils.js
|
@ -263,5 +263,7 @@ U._getOrCreateKeypair = function(db, subject, query, keyType, mustExist) {
|
||||||
};
|
};
|
||||||
|
|
||||||
U._getKeypair = function(db, subject, query) {
|
U._getKeypair = function(db, subject, query) {
|
||||||
return U._getOrCreateKeypair(db, subject, query, '', true);
|
return U._getOrCreateKeypair(db, subject, query, '', true).then(function (result) {
|
||||||
|
return result.keypair;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue