Skip to content

Commit cd2daa1

Browse files
committed
Require email verification for contact form
1 parent 8b6bbe0 commit cd2daa1

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

packages/backend/src/routers/contactUs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ router.post('/contactUs', auth, express.json(), async (req, res, next)=>{
3333
next();
3434

3535
// check if user is verified
36-
if((config.strict_email_verification_required || req.user.requires_email_confirmation) && !req.user.email_confirmed)
36+
if(req.user.email_confirmed)
3737
return res.status(400).send({code: 'account_is_not_verified', message: 'Account is not verified'});
3838

3939
// message is required

src/UI/UIWindowFeedback.js

+8
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,20 @@
1717
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919

20+
import UIAlert from './UIAlert.js';
2021
import UIWindow from './UIWindow.js'
2122

2223
async function UIWindowQR(options){
2324
return new Promise(async (resolve) => {
2425
options = options ?? {};
2526

27+
if ( ! window.user.email_confirmed ) {
28+
await UIAlert({
29+
message: i18n('contact_us_verification_required'),
30+
});
31+
return resolve();
32+
}
33+
2634
let h = '';
2735
h += `<div style="padding: 20px; margin-top: 0;">`;
2836
// success

src/i18n/translations/en.js

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const en = {
6565
confirm_delete_user_title: "Delete Account?",
6666
confirm_session_revoke: "Are you sure you want to revoke this session?",
6767
contact_us: "Contact Us",
68+
contact_us_verification_required: "You must have a verified email address to to use this.",
6869
contain: 'Contain',
6970
continue: "Continue",
7071
copy: 'Copy',

0 commit comments

Comments
 (0)