Bugfix for DB lookup by username for certain internal methods/functions.
This commit is contained in:
parent
27ab1c2c71
commit
f0555169fe
4 changed files with 6 additions and 6 deletions
|
|
@ -60,7 +60,7 @@ module.exports.post = async function(req, res){
|
|||
|
||||
|
||||
//Look through DB and migration cache for existing email
|
||||
const existingDB = await userModel.findOne({email: new RegExp(email, 'i')});
|
||||
const existingDB = await userModel.findOne({email: new RegExp(`^${email}$`, 'i')});
|
||||
const needsMigration = userModel.migrationCache.emails.includes(email.toLowerCase());
|
||||
|
||||
//If the email is in use
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ module.exports.post = async function(req, res){
|
|||
const {user, pass} = matchedData(req);
|
||||
|
||||
//Look for the username in the migration DB
|
||||
const migrationDB = await migrationModel.findOne({user});
|
||||
const migrationDB = await migrationModel.findOne({user: new RegExp(`^${user}$`, 'i')});
|
||||
|
||||
//If we found a migration profile
|
||||
if(migrationDB != null){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue