From 30319d8e44a6e5d29502c29c2f3a8212323414f9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 11 Oct 2016 11:12:02 +0100 Subject: [PATCH 1/2] Fix registration retry We need to clear the current stage & start from the beginning again when we start a new registration attempt. --- src/Signup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Signup.js b/src/Signup.js index 8185addd6d..c2d74adca9 100644 --- a/src/Signup.js +++ b/src/Signup.js @@ -123,6 +123,7 @@ class Register extends Signup { this.username = username; this.password = password; const client = this._createTemporaryClient(); + this.activeStage = null; return this._tryRegister(client); } From b62fb5061955be7be4c373dc8d11d78e4f4c5df7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 11 Oct 2016 11:58:10 +0100 Subject: [PATCH 2/2] Add some docs for the lifetime of Signup --- src/Signup.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Signup.js b/src/Signup.js index c2d74adca9..18d338cc32 100644 --- a/src/Signup.js +++ b/src/Signup.js @@ -51,6 +51,9 @@ class Signup { /** * Registration logic class + * This exists for the lifetime of a user's attempt to register an account, + * so if their registration attempt fails for whatever reason and they + * try again, call register() on the same instance again. */ class Register extends Signup { constructor(hsUrl, isUrl, opts) { @@ -117,6 +120,9 @@ class Register extends Signup { }); } + /** + * Starts the registration process from the first stage + */ register(formVals) { var {username, password, email} = formVals; this.email = email;