This commit is contained in:
Tankred Hase 2016-05-28 10:49:26 +02:00
parent 629a8ee9dd
commit dcd2d0df0c
2 changed files with 7 additions and 7 deletions

View File

@ -72,6 +72,7 @@ class PublicKey {
}
// persist new user ids
let userIds = yield this._userid.batch(params);
// send mails to verify user ids (send only one if primary email is provided)
yield this._email.sendVerification({ userIds, primaryEmail:options.primaryEmail });
}
@ -115,11 +116,10 @@ class PublicKey {
keyid: keyid ? keyid.toUpperCase() : undefined,
userIds: email ? [{ email:email.toLowerCase() }] : undefined
});
if (verified) {
return yield this._mongo.get({ _id:verified.keyid }, DB_TYPE);
} else {
if (!verified) {
throw util.error(404, 'Key not found');
}
return yield this._mongo.get({ _id:verified.keyid }, DB_TYPE);
}
flagForRemove() {

View File

@ -49,18 +49,18 @@ router.get('/pks/lookup', function *() { // ?op=get&search=0x1234567890123456
router.post('/api/v1/key', function *() { // { publicKeyArmored, primaryEmail } hint the primary email address
yield rest.create(this);
});
router.get('/api/v1/key', function *() { // ?id=keyid OR ?email=email
router.get('/api/v1/key', function *() { // ?keyid=keyid OR ?email=email
yield rest.read(this);
});
router.del('/api/v1/key', function *() { // ?id=keyid OR ?email=email
router.del('/api/v1/key', function *() { // ?keyid=keyid OR ?email=email
yield rest.remove(this);
});
// links for verification and sharing
router.get('/api/v1/verify', function *() { // ?id=keyid&nonce=nonce
router.get('/api/v1/verify', function *() { // ?keyid=keyid&nonce=nonce
yield rest.verify(this);
});
router.get('/api/v1/verifyRemove', function *() { // ?id=keyid&nonce=nonce
router.get('/api/v1/verifyRemove', function *() { // ?keyid=keyid&nonce=nonce
yield rest.verifyRemove(this);
});
router.get('/:email', function *() { // shorthand link for sharing