Skip to content

Commit

Permalink
[FIX] Can't change password (#18836)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh committed Sep 9, 2020
1 parent 68023c0 commit 6b8acd3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/account/AccountProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const AccountProfilePage = () => {
nickname,
} = values;

const { handleAvatar } = handlers;
const { handleAvatar, handlePassword, handleConfirmationPassword } = handlers;

const updateAvatar = useUpdateAvatar(avatar, user._id);

Expand All @@ -140,14 +140,16 @@ const AccountProfilePage = () => {
await saveFn({
...allowRealNameChange && { realname },
...allowEmailChange && getUserEmailAddress(user) !== email && { email },
...allowPasswordChange && { password },
...allowPasswordChange && { newPassword: password },
...canChangeUsername && { username },
...allowUserStatusMessageChange && { statusText },
...typedPassword && { typedPassword: SHA256(typedPassword) },
statusType,
nickname,
bio: bio || '',
}, customFields);
handlePassword('');
handleConfirmationPassword('');
commit();
dispatchToastMessage({ type: 'success', message: t('Profile_saved_successfully') });
} catch (error) {
Expand Down Expand Up @@ -191,6 +193,8 @@ const AccountProfilePage = () => {
setModal,
commit,
nickname,
handlePassword,
handleConfirmationPassword,
]);

const handleLogoutOtherLocations = useCallback(async () => {
Expand Down

0 comments on commit 6b8acd3

Please sign in to comment.