mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 11:46:23 +00:00
fix(script): don't use extremely costly regex
This commit is contained in:
parent
9bfb2afd9c
commit
ec78831a81
1 changed files with 2 additions and 3 deletions
|
|
@ -71,15 +71,14 @@ async function deleteHabiticaData (user, email) {
|
|||
}
|
||||
|
||||
async function processEmailAddress (email) {
|
||||
const emailRegex = new RegExp(`^${email}$`, 'i');
|
||||
const localUsers = await User.find(
|
||||
{ 'auth.local.email': emailRegex },
|
||||
{ 'auth.local.email': email },
|
||||
{ _id: 1, apiToken: 1, auth: 1 },
|
||||
).exec();
|
||||
|
||||
const socialUsers = await User.find(
|
||||
{
|
||||
'auth.local.email': { $not: emailRegex },
|
||||
'auth.local.email': { $ne: email },
|
||||
$or: [
|
||||
{ 'auth.facebook.emails.value': email },
|
||||
{ 'auth.google.emails.value': email },
|
||||
|
|
|
|||
Loading…
Reference in a new issue