mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
fix(apple auth): minor fixes, make sure apple auth users are considered when sending emails
This commit is contained in:
@@ -280,7 +280,10 @@ api.deleteUser = {
|
||||
if (user.auth.local.hashed_password && user.auth.local.email) {
|
||||
const isValidPassword = await passwordUtils.compare(user, password);
|
||||
if (!isValidPassword) throw new NotAuthorized(res.t('wrongPassword'));
|
||||
} else if ((user.auth.facebook.id || user.auth.google.id) && password !== DELETE_CONFIRMATION) {
|
||||
} else if (
|
||||
(user.auth.facebook.id || user.auth.google.id || user.auth.apple.id)
|
||||
&& password !== DELETE_CONFIRMATION
|
||||
) {
|
||||
throw new NotAuthorized(res.t('incorrectDeletePhrase', { magicWord: 'DELETE' }));
|
||||
}
|
||||
|
||||
@@ -366,6 +369,7 @@ api.getUserAnonymized = {
|
||||
delete user.auth.local;
|
||||
delete user.auth.facebook;
|
||||
delete user.auth.google;
|
||||
delete user.auth.apple;
|
||||
}
|
||||
delete user.newMessages;
|
||||
delete user.profile;
|
||||
|
||||
Reference in New Issue
Block a user