From 2a54fe321f728440c6f59eacaaaf40e18be6b12f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 10 Jul 2019 11:26:09 -0600 Subject: [PATCH] Use the state variable for the password when deactivating The Field is controlled, so we should be using the state. Otherwise the value is undefined, which means we don't supply the required auth. Fixes https://github.com/vector-im/riot-web/issues/10302 Regressed in https://github.com/matrix-org/matrix-react-sdk/pull/3071 --- src/components/views/dialogs/DeactivateAccountDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/DeactivateAccountDialog.js b/src/components/views/dialogs/DeactivateAccountDialog.js index e9f38ef27c..cdb5950313 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.js +++ b/src/components/views/dialogs/DeactivateAccountDialog.js @@ -64,13 +64,13 @@ export default class DeactivateAccountDialog extends React.Component { const auth = { type: 'm.login.password', user: MatrixClientPeg.get().credentials.userId, - password: this._passwordField.value, + password: this.state.password, }; await MatrixClientPeg.get().deactivateAccount(auth, this.state.shouldErase); } catch (err) { let errStr = _t('Unknown error'); // https://matrix.org/jira/browse/SYN-744 - if (err.httpStatus == 401 || err.httpStatus == 403) { + if (err.httpStatus === 401 || err.httpStatus === 403) { errStr = _t('Incorrect password'); Velocity(this._passwordField, "callout.shake", 300); }