mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-14 19:47:03 +00:00
fix(gdpr): unique key fix
This commit is contained in:
parent
1bb337d235
commit
c9bb96d2be
1 changed files with 2 additions and 1 deletions
|
|
@ -34,11 +34,12 @@ async function deleteAmplitudeData (userId, email) {
|
|||
}
|
||||
|
||||
async function deleteHabiticaData (user, email) {
|
||||
const truncatedEmail = email.slice(0, email.indexOf('@'));
|
||||
await User.update(
|
||||
{ _id: user._id },
|
||||
{
|
||||
$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.passwordHashMethod': 'bcrypt',
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue