Fixed e-mail password recovery.

This commit is contained in:
Ylian Saint-Hilaire 2019-02-11 14:59:04 -08:00
parent a0edd68ac4
commit 168322c146
5 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.2.7-v",
"version": "0.2.7-x",
"keywords": [
"Remote Management",
"Intel AMT",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -568,10 +568,11 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
const domain = checkUserIpAddress(req, res);
if ((domain == null) || (domain.auth == 'sspi')) return;
// Get the email from the body or session.
var email = req.body.email;
if ((email == null) || (email == '')) { email = req.session.tokenemail; }
if ((domain.newaccounts === 0) || (domain.newaccounts === false)) { res.sendStatus(401); return; }
// Check the email stirng format
if (!email || checkEmail(email) == false) {
req.session.loginmode = 3;
req.session.error = '<b style=color:#8C001A>Invalid email.</b>';