Skip to content

Commit 515f10b

Browse files
authored
Merge pull request matrix-org#512 from matrix-org/dbkr/fix_registration_retry
Fix registration retry
2 parents 55437d7 + b62fb50 commit 515f10b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Signup.js

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class Signup {
5151

5252
/**
5353
* Registration logic class
54+
* This exists for the lifetime of a user's attempt to register an account,
55+
* so if their registration attempt fails for whatever reason and they
56+
* try again, call register() on the same instance again.
5457
*/
5558
class Register extends Signup {
5659
constructor(hsUrl, isUrl, opts) {
@@ -117,12 +120,16 @@ class Register extends Signup {
117120
});
118121
}
119122

123+
/**
124+
* Starts the registration process from the first stage
125+
*/
120126
register(formVals) {
121127
var {username, password, email} = formVals;
122128
this.email = email;
123129
this.username = username;
124130
this.password = password;
125131
const client = this._createTemporaryClient();
132+
this.activeStage = null;
126133
return this._tryRegister(client);
127134
}
128135

0 commit comments

Comments
 (0)