diff --git a/app/lib/server/methods/deleteUserOwnAccount.js b/app/lib/server/methods/deleteUserOwnAccount.js index 4a655856ec571..1ff7494a87516 100644 --- a/app/lib/server/methods/deleteUserOwnAccount.js +++ b/app/lib/server/methods/deleteUserOwnAccount.js @@ -1,6 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; +import { SHA256 } from 'meteor/sha'; import s from 'underscore.string'; import { settings } from '../../../settings'; @@ -34,7 +35,7 @@ Meteor.methods({ if (result.error) { throw new Meteor.Error('error-invalid-password', 'Invalid password', { method: 'deleteUserOwnAccount' }); } - } else if (user.username !== s.trim(password)) { + } else if (SHA256(user.username) !== s.trim(password)) { throw new Meteor.Error('error-invalid-username', 'Invalid username', { method: 'deleteUserOwnAccount' }); } diff --git a/client/views/account/AccountProfilePage.js b/client/views/account/AccountProfilePage.js index 789e586902292..ffc211ca7406a 100644 --- a/client/views/account/AccountProfilePage.js +++ b/client/views/account/AccountProfilePage.js @@ -231,7 +231,6 @@ const AccountProfilePage = () => { onCancel={closeModal} title={title} text={t('If_you_are_sure_type_in_your_username')} - isPassword /> )); }, [closeModal, deleteOwnAccount, dispatchToastMessage, erasureType, localPassword, t, setModal]);