Require email verification for contact form

This commit is contained in:
KernelDeimos 2024-05-09 19:40:34 -04:00
parent 8b6bbe003d
commit cd2daa1910
3 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -17,12 +17,20 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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 += `<div style="padding: 20px; margin-top: 0;">`;
// success

View File

@ -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',