mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
fix(gdpr): unique key fix
This commit is contained in:
@@ -34,11 +34,12 @@ async function deleteAmplitudeData (userId, email) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function deleteHabiticaData (user, email) {
|
async function deleteHabiticaData (user, email) {
|
||||||
|
const truncatedEmail = email.slice(0, email.indexOf('@'));
|
||||||
await User.update(
|
await User.update(
|
||||||
{ _id: user._id },
|
{ _id: user._id },
|
||||||
{
|
{
|
||||||
$set: {
|
$set: {
|
||||||
'auth.local.email': email,
|
'auth.local.email': user.auth.local.email ? email : `${truncatedEmail}@habitica.com`,
|
||||||
'auth.local.hashed_password': '$2a$10$QDnNh1j1yMPnTXDEOV38xOePEWFd4X8DSYwAM8XTmqmacG5X0DKjW',
|
'auth.local.hashed_password': '$2a$10$QDnNh1j1yMPnTXDEOV38xOePEWFd4X8DSYwAM8XTmqmacG5X0DKjW',
|
||||||
'auth.local.passwordHashMethod': 'bcrypt',
|
'auth.local.passwordHashMethod': 'bcrypt',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user