diff --git a/src/Signup.js b/src/Signup.js
index 4518955d95..5aadd94701 100644
--- a/src/Signup.js
+++ b/src/Signup.js
@@ -152,7 +152,10 @@ class Register extends Signup {
console.log("Active flow => %s", JSON.stringify(flow));
var flowStage = self.firstUncompletedStage(flow);
if (flowStage != self.activeStage) {
- return self.startStage(flowStage);
+ return self.startStage(flowStage).catch(function(err) {
+ self.setStep('START');
+ throw err;
+ });
}
}
}
diff --git a/src/SignupStages.js b/src/SignupStages.js
index 1c5c48ddd6..2b0d163a08 100644
--- a/src/SignupStages.js
+++ b/src/SignupStages.js
@@ -170,7 +170,7 @@ class EmailIdentityStage extends Stage {
encodeURIComponent(this.signupInstance.getServerData().session);
var self = this;
- return this.client.requestEmailToken(
+ return this.client.requestRegisterEmailToken(
this.signupInstance.email,
this.clientSecret,
1, // TODO: Multiple send attempts?
@@ -186,8 +186,8 @@ class EmailIdentityStage extends Stage {
var e = {
isFatal: true
};
- if (error.errcode == 'THREEPID_IN_USE') {
- e.message = "Email in use";
+ if (error.errcode == 'M_THREEPID_IN_USE') {
+ e.message = "This email address is already registered";
} else {
e.message = 'Unable to contact the given identity server';
}
diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js
index 2f15a3b5df..4615031760 100644
--- a/src/components/structures/login/Registration.js
+++ b/src/components/structures/login/Registration.js
@@ -54,6 +54,9 @@ module.exports = React.createClass({
return {
busy: false,
errorText: null,
+ formVals: {
+ email: this.props.email,
+ },
};
},
@@ -108,7 +111,8 @@ module.exports = React.createClass({
var self = this;
this.setState({
errorText: "",
- busy: true
+ busy: true,
+ formVals: formVals,
});
if (formVals.username !== this.props.username) {
@@ -228,11 +232,15 @@ module.exports = React.createClass({
break; // NOP
case "Register.START":
case "Register.STEP_m.login.dummy":
+ // NB. Our 'username' prop is specifically for upgrading
+ // a guest account
registerStep = (
- { this.props.defaultUsername ?
+ { this.props.guestUsername ?