Fix keyId in email links
This commit is contained in:
@@ -55,11 +55,12 @@ class Email {
|
||||
* Send the verification email to the user using a template.
|
||||
* @param {Object} template the email template to use
|
||||
* @param {Object} userId user id document
|
||||
* @param {string} keyId key id of public key
|
||||
* @param {Object} origin origin of the server
|
||||
* @yield {Object} send response from the SMTP server
|
||||
*/
|
||||
*send(options) {
|
||||
let template = options.template, userId = options.userId, origin = options.origin;
|
||||
let template = options.template, userId = options.userId, keyId = options.keyId, origin = options.origin;
|
||||
let message = {
|
||||
from: this._sender,
|
||||
to: userId,
|
||||
@@ -69,7 +70,7 @@ class Email {
|
||||
params: {
|
||||
name: userId.name,
|
||||
baseUrl: origin.protocol + '://' + origin.host,
|
||||
keyid: encodeURIComponent(userId.keyid),
|
||||
keyId: encodeURIComponent(keyId),
|
||||
nonce: encodeURIComponent(userId.nonce)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"verifyKey": {
|
||||
"subject": "Verify Your Key",
|
||||
"text": "Hello {{name}},\n\nplease click here to verify your key:\n\n{{baseUrl}}/api/v1/verify?keyid={{keyid}}&nonce={{nonce}}",
|
||||
"html": "<p>Hello {{name}},</p><p>please <a href=\"{{baseUrl}}/api/v1/verify?keyid={{keyid}}&nonce={{nonce}}\">click here to verify</a> your key.</p>"
|
||||
"text": "Hello {{name}},\n\nplease click here to verify your key:\n\n{{baseUrl}}/api/v1/verify?id={{keyId}}&nonce={{nonce}}",
|
||||
"html": "<p>Hello {{name}},</p><p>please <a href=\"{{baseUrl}}/api/v1/verify?id={{keyId}}&nonce={{nonce}}\">click here to verify</a> your key.</p>"
|
||||
},
|
||||
"verifyRemove": {
|
||||
"subject": "Verify Key Removal",
|
||||
"text": "Hello {{name}},\n\nplease click here to verify the removal of your key:\n\n{{baseUrl}}/api/v1/verifyRemove?keyid={{keyid}}&nonce={{nonce}}",
|
||||
"html": "<p>Hello {{name}},</p><p>please <a href=\"{{baseUrl}}/api/v1/verifyRemove?keyid={{keyid}}&nonce={{nonce}}\">click here to verify</a> the removal of your key.</p>"
|
||||
"text": "Hello {{name}},\n\nplease click here to verify the removal of your key:\n\n{{baseUrl}}/api/v1/verifyRemove?id={{keyId}}&nonce={{nonce}}",
|
||||
"html": "<p>Hello {{name}},</p><p>please <a href=\"{{baseUrl}}/api/v1/verifyRemove?id={{keyId}}&nonce={{nonce}}\">click here to verify</a> the removal of your key.</p>"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user