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
This commit is contained in:
parent
4e53e522fb
commit
2a54fe321f
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue