diff --git a/packages/backend/src/routers/contactUs.js b/packages/backend/src/routers/contactUs.js index 14b25426..80c92bda 100644 --- a/packages/backend/src/routers/contactUs.js +++ b/packages/backend/src/routers/contactUs.js @@ -33,7 +33,7 @@ router.post('/contactUs', auth, express.json(), async (req, res, next)=>{ next(); // check if user is verified - if((config.strict_email_verification_required || req.user.requires_email_confirmation) && !req.user.email_confirmed) + if(req.user.email_confirmed) return res.status(400).send({code: 'account_is_not_verified', message: 'Account is not verified'}); // message is required diff --git a/src/UI/UIWindowFeedback.js b/src/UI/UIWindowFeedback.js index 92ab92a5..77aa366e 100644 --- a/src/UI/UIWindowFeedback.js +++ b/src/UI/UIWindowFeedback.js @@ -17,12 +17,20 @@ * along with this program. If not, see . */ +import UIAlert from './UIAlert.js'; import UIWindow from './UIWindow.js' async function UIWindowQR(options){ return new Promise(async (resolve) => { options = options ?? {}; + if ( ! window.user.email_confirmed ) { + await UIAlert({ + message: i18n('contact_us_verification_required'), + }); + return resolve(); + } + let h = ''; h += `
`; // success diff --git a/src/i18n/translations/en.js b/src/i18n/translations/en.js index edee5410..598cb39c 100644 --- a/src/i18n/translations/en.js +++ b/src/i18n/translations/en.js @@ -65,6 +65,7 @@ const en = { confirm_delete_user_title: "Delete Account?", confirm_session_revoke: "Are you sure you want to revoke this session?", contact_us: "Contact Us", + contact_us_verification_required: "You must have a verified email address to to use this.", contain: 'Contain', continue: "Continue", copy: 'Copy',