From 8a02e064bd98569cdadfd52b9cca15fbf39e62cb Mon Sep 17 00:00:00 2001 From: Zoe Date: Fri, 1 May 2020 11:03:48 +0100 Subject: [PATCH] Don't erase password confirm on registration error Fixes: https://github.com/vector-im/riot-web/issues/11395 Problem here was that the form gets re-mounted but there wasn't a facility to preserve the password confirmation field. Since the form validates that the passwords are equal, if we mount with a password supplied we just copy it over. --- src/components/views/auth/RegistrationForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index f1624bc9e5..2a79bb8588 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -76,7 +76,7 @@ export default createReactClass({ email: this.props.defaultEmail || "", phoneNumber: this.props.defaultPhoneNumber || "", password: this.props.defaultPassword || "", - passwordConfirm: "", + passwordConfirm: this.props.defaultPassword || "", passwordComplexity: null, passwordSafe: false, };