Cleanup
This commit is contained in:
parent
629a8ee9dd
commit
dcd2d0df0c
@ -72,6 +72,7 @@ class PublicKey {
|
|||||||
}
|
}
|
||||||
// persist new user ids
|
// persist new user ids
|
||||||
let userIds = yield this._userid.batch(params);
|
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 });
|
yield this._email.sendVerification({ userIds, primaryEmail:options.primaryEmail });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,11 +116,10 @@ class PublicKey {
|
|||||||
keyid: keyid ? keyid.toUpperCase() : undefined,
|
keyid: keyid ? keyid.toUpperCase() : undefined,
|
||||||
userIds: email ? [{ email:email.toLowerCase() }] : undefined
|
userIds: email ? [{ email:email.toLowerCase() }] : undefined
|
||||||
});
|
});
|
||||||
if (verified) {
|
if (!verified) {
|
||||||
return yield this._mongo.get({ _id:verified.keyid }, DB_TYPE);
|
|
||||||
} else {
|
|
||||||
throw util.error(404, 'Key not found');
|
throw util.error(404, 'Key not found');
|
||||||
}
|
}
|
||||||
|
return yield this._mongo.get({ _id:verified.keyid }, DB_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
flagForRemove() {
|
flagForRemove() {
|
||||||
|
@ -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
|
router.post('/api/v1/key', function *() { // { publicKeyArmored, primaryEmail } hint the primary email address
|
||||||
yield rest.create(this);
|
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);
|
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);
|
yield rest.remove(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
// links for verification and sharing
|
// 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);
|
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);
|
yield rest.verifyRemove(this);
|
||||||
});
|
});
|
||||||
router.get('/:email', function *() { // shorthand link for sharing
|
router.get('/:email', function *() { // shorthand link for sharing
|
||||||
|
Loading…
Reference in New Issue
Block a user