mirror of https://github.com/vector-im/riot-web
Port registration fixes
parent
65498600de
commit
1b82d92fa1
|
@ -198,12 +198,6 @@ module.exports = {
|
||||||
this.setState({busy: true});
|
this.setState({busy: true});
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.savedParams = {
|
|
||||||
email: formVals.email,
|
|
||||||
username: formVals.username,
|
|
||||||
password: formVals.password
|
|
||||||
};
|
|
||||||
|
|
||||||
this.tryRegister();
|
this.tryRegister();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -240,10 +234,14 @@ module.exports = {
|
||||||
});
|
});
|
||||||
self.setStep('stage_m.login.email.identity');
|
self.setStep('stage_m.login.email.identity');
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
self.setState({
|
self.setStep('initial');
|
||||||
busy: false,
|
var newState = {busy: false};
|
||||||
errorText: 'Unable to contact the given Home Server'
|
if (error.errcode == 'THREEPID_IN_USE') {
|
||||||
});
|
self.onBadFields({email: self.FieldErrors.InUse});
|
||||||
|
} else {
|
||||||
|
newState.errorText = 'Unable to contact the given Home Server';
|
||||||
|
}
|
||||||
|
self.setState(newState);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'm.login.recaptcha':
|
case 'm.login.recaptcha':
|
||||||
|
@ -324,6 +322,14 @@ module.exports = {
|
||||||
});
|
});
|
||||||
} else if (error.httpStatus == 401) {
|
} else if (error.httpStatus == 401) {
|
||||||
newState.errorText = "Authorisation failed!";
|
newState.errorText = "Authorisation failed!";
|
||||||
|
} else if (error.httpStatus >= 400 && error.httpStatus < 500) {
|
||||||
|
newState.errorText = "Registration failed!";
|
||||||
|
} else if (error.httpStatus >= 500 && error.httpStatus < 600) {
|
||||||
|
newState.errorText = "Server error during registration!";
|
||||||
|
} else if (error.name == "M_MISSING_PARAM") {
|
||||||
|
// The HS hasn't remembered the login params from
|
||||||
|
// the first try when the login email was sent.
|
||||||
|
newState.errorText = "This home server does not support resuming registration.";
|
||||||
}
|
}
|
||||||
self.setState(newState);
|
self.setState(newState);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue