mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-03 07:46:14 +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();
|
next();
|
||||||
|
|
||||||
// check if user is verified
|
// 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'});
|
return res.status(400).send({code: 'account_is_not_verified', message: 'Account is not verified'});
|
||||||
|
|
||||||
// message is required
|
// message is required
|
||||||
|
@ -17,12 +17,20 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import UIAlert from './UIAlert.js';
|
||||||
import UIWindow from './UIWindow.js'
|
import UIWindow from './UIWindow.js'
|
||||||
|
|
||||||
async function UIWindowQR(options){
|
async function UIWindowQR(options){
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
options = options ?? {};
|
options = options ?? {};
|
||||||
|
|
||||||
|
if ( ! window.user.email_confirmed ) {
|
||||||
|
await UIAlert({
|
||||||
|
message: i18n('contact_us_verification_required'),
|
||||||
|
});
|
||||||
|
return resolve();
|
||||||
|
}
|
||||||
|
|
||||||
let h = '';
|
let h = '';
|
||||||
h += `<div style="padding: 20px; margin-top: 0;">`;
|
h += `<div style="padding: 20px; margin-top: 0;">`;
|
||||||
// success
|
// success
|
||||||
|
@ -65,6 +65,7 @@ const en = {
|
|||||||
confirm_delete_user_title: "Delete Account?",
|
confirm_delete_user_title: "Delete Account?",
|
||||||
confirm_session_revoke: "Are you sure you want to revoke this session?",
|
confirm_session_revoke: "Are you sure you want to revoke this session?",
|
||||||
contact_us: "Contact Us",
|
contact_us: "Contact Us",
|
||||||
|
contact_us_verification_required: "You must have a verified email address to to use this.",
|
||||||
contain: 'Contain',
|
contain: 'Contain',
|
||||||
continue: "Continue",
|
continue: "Continue",
|
||||||
copy: 'Copy',
|
copy: 'Copy',
|
||||||
|
Loading…
Reference in New Issue
Block a user