mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-15 10:17:33 -05:00
fixed case in email
This commit is contained in:
@@ -14,10 +14,10 @@ const local = new LocalStrategy({
|
|||||||
}, async (email, password, done) => {
|
}, async (email, password, done) => {
|
||||||
const user = await User.findOne({
|
const user = await User.findOne({
|
||||||
$or: [{
|
$or: [{
|
||||||
email
|
email: { '$regex': email, $options: 'i' }
|
||||||
}, {
|
}, {
|
||||||
local: {
|
local: {
|
||||||
email
|
email: { '$regex': email, $options: 'i' }
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ exports.confirmEmail = async function (req, res, next) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (user.confirmEmailToken != token) {
|
if (user.confirmEmailToken != token) {
|
||||||
|
res.status(500);
|
||||||
console.error(
|
console.error(
|
||||||
"Token Mismatch DB: " + user.confirmEmailToken + " submitted: " + token
|
"Token Mismatch DB: " + user.confirmEmailToken + " submitted: " + token
|
||||||
);
|
);
|
||||||
@@ -267,7 +268,7 @@ exports.resetPassword = async function (req, res, next) {
|
|||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
exports.sendResetPassword = async function (req, res, next) {
|
exports.sendResetPassword = async function (req, res, next) {
|
||||||
let user = await User.findOne({
|
let user = await User.findOne({
|
||||||
email: req.body.email
|
email: { '$regex': req.body.email, $options: 'i' }
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
res.status(500);
|
res.status(500);
|
||||||
@@ -550,7 +551,8 @@ exports.updateProfile = async function (req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lets make sure someone else isn't using this screenName
|
// Lets make sure someone else isn't using this screenName
|
||||||
screenNameUser = await User.findOne({ screenName: req.body.screenName }).catch(err => {
|
|
||||||
|
screenNameUser = await User.findOne({ screenName: { '$regex': req.body.screenName , $options: 'i' } }).catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
res.status(500);
|
res.status(500);
|
||||||
res.json({
|
res.json({
|
||||||
@@ -614,12 +616,12 @@ exports.register = async function (req, res, next) {
|
|||||||
|
|
||||||
let user = await User.findOne({
|
let user = await User.findOne({
|
||||||
$or: [{
|
$or: [{
|
||||||
email: req.body.email
|
email: { '$regex': req.body.email, $options: 'i' }
|
||||||
}, {
|
}, {
|
||||||
local: {
|
local: {
|
||||||
email: req.body.email
|
email: { '$regex': req.body.email, $options: 'i' }
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
res.status(500);
|
res.status(500);
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ const User = require("../../models/user");
|
|||||||
}, (email, password, done) => {
|
}, (email, password, done) => {
|
||||||
User.findOne({
|
User.findOne({
|
||||||
$or: [{
|
$or: [{
|
||||||
email
|
email: { '$regex': email, $options: 'i' }
|
||||||
}, {
|
}, {
|
||||||
local: {
|
local: {
|
||||||
email
|
email: { '$regex': email, $options: 'i' }
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}, (err, user) => {
|
}, (err, user) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user