Skip to content
Snippets Groups Projects
Unverified Commit 6b8acd39 authored by gabriellsh's avatar gabriellsh Committed by GitHub
Browse files

[FIX] Can't change password (#18836)

parent 68023c0c
No related branches found
No related tags found
No related merge requests found
...@@ -128,7 +128,7 @@ const AccountProfilePage = () => { ...@@ -128,7 +128,7 @@ const AccountProfilePage = () => {
nickname, nickname,
} = values; } = values;
const { handleAvatar } = handlers; const { handleAvatar, handlePassword, handleConfirmationPassword } = handlers;
const updateAvatar = useUpdateAvatar(avatar, user._id); const updateAvatar = useUpdateAvatar(avatar, user._id);
...@@ -140,7 +140,7 @@ const AccountProfilePage = () => { ...@@ -140,7 +140,7 @@ const AccountProfilePage = () => {
await saveFn({ await saveFn({
...allowRealNameChange && { realname }, ...allowRealNameChange && { realname },
...allowEmailChange && getUserEmailAddress(user) !== email && { email }, ...allowEmailChange && getUserEmailAddress(user) !== email && { email },
...allowPasswordChange && { password }, ...allowPasswordChange && { newPassword: password },
...canChangeUsername && { username }, ...canChangeUsername && { username },
...allowUserStatusMessageChange && { statusText }, ...allowUserStatusMessageChange && { statusText },
...typedPassword && { typedPassword: SHA256(typedPassword) }, ...typedPassword && { typedPassword: SHA256(typedPassword) },
...@@ -148,6 +148,8 @@ const AccountProfilePage = () => { ...@@ -148,6 +148,8 @@ const AccountProfilePage = () => {
nickname, nickname,
bio: bio || '', bio: bio || '',
}, customFields); }, customFields);
handlePassword('');
handleConfirmationPassword('');
commit(); commit();
dispatchToastMessage({ type: 'success', message: t('Profile_saved_successfully') }); dispatchToastMessage({ type: 'success', message: t('Profile_saved_successfully') });
} catch (error) { } catch (error) {
...@@ -191,6 +193,8 @@ const AccountProfilePage = () => { ...@@ -191,6 +193,8 @@ const AccountProfilePage = () => {
setModal, setModal,
commit, commit,
nickname, nickname,
handlePassword,
handleConfirmationPassword,
]); ]);
const handleLogoutOtherLocations = useCallback(async () => { const handleLogoutOtherLocations = useCallback(async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment