mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 22:40:20 +08:00
Require email verification for contact form
This commit is contained in:
parent
8b6bbe003d
commit
cd2daa1910
@ -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
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user