Merge branch 'release' into develop

This commit is contained in:
Matteo Pagliazzi 2020-07-03 15:07:29 +02:00
commit 680e86d2c9
3 changed files with 9 additions and 9 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "habitica",
"version": "4.147.2",
"version": "4.147.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,7 +1,7 @@
{
"name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "4.147.2",
"version": "4.147.3",
"main": "./website/server/index.js",
"dependencies": {
"@babel/core": "^7.10.3",

View file

@ -35,15 +35,14 @@ async function deleteAmplitudeData (userId, email) {
async function deleteHabiticaData (user, email) {
const truncatedEmail = email.slice(0, email.indexOf('@'));
const set = {
'auth.local.hashed_password': '$2a$10$QDnNh1j1yMPnTXDEOV38xOePEWFd4X8DSYwAM8XTmqmacG5X0DKjW',
'auth.local.passwordHashMethod': 'bcrypt',
};
if (!user.auth.local.email) set['auth.local.email'] = `${truncatedEmail}@example.com`;
await User.update(
{ _id: user._id },
{
$set: {
'auth.local.email': user.auth.local.email ? email : `${truncatedEmail}@example.com`,
'auth.local.hashed_password': '$2a$10$QDnNh1j1yMPnTXDEOV38xOePEWFd4X8DSYwAM8XTmqmacG5X0DKjW',
'auth.local.passwordHashMethod': 'bcrypt',
},
},
{ $set: set },
);
const response = await axios.delete(
`${BASE_URL}/api/v3/user`,
@ -78,6 +77,7 @@ async function processEmailAddress (email) {
const socialUsers = await User.find(
{
'auth.local.email': { $not: emailRegex },
$or: [
{ 'auth.facebook.emails.value': email },
{ 'auth.google.emails.value': email },