mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: dont generate UUID if no email
This commit is contained in:
@@ -124,11 +124,6 @@ UserEmail.sendValidationEmail = async function (uid, options) {
|
||||
};
|
||||
}
|
||||
|
||||
const confirm_code = utils.generateUUID();
|
||||
const confirm_link = `${nconf.get('url')}/confirm/${confirm_code}`;
|
||||
|
||||
const { emailConfirmInterval, emailConfirmExpiry } = meta.config;
|
||||
|
||||
// If no email passed in (default), retrieve email from uid
|
||||
if (!options.email || !options.email.length) {
|
||||
options.email = await user.getUserField(uid, 'email');
|
||||
@@ -138,10 +133,13 @@ UserEmail.sendValidationEmail = async function (uid, options) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { emailConfirmInterval, emailConfirmExpiry } = meta.config;
|
||||
if (!options.force && !await UserEmail.canSendValidation(uid, options.email)) {
|
||||
throw new Error(`[[error:confirm-email-already-sent, ${emailConfirmInterval}]]`);
|
||||
}
|
||||
|
||||
const confirm_code = utils.generateUUID();
|
||||
const confirm_link = `${nconf.get('url')}/confirm/${confirm_code}`;
|
||||
const username = await user.getUserField(uid, 'username');
|
||||
const data = await plugins.hooks.fire('filter:user.verify', {
|
||||
uid,
|
||||
|
||||
Reference in New Issue
Block a user