Allow registering with email if no ID Server

If the server advertises that it supports doing so

This version uses a random me.dbkr prefix until the MSC is
written.

Requires https://github.com/matrix-org/matrix-js-sdk/pull/1017
Implements https://github.com/matrix-org/matrix-doc/pull/2233
This commit is contained in:
David Baker 2019-08-16 11:57:32 +01:00
parent ded2297523
commit e705d110af
2 changed files with 25 additions and 8 deletions

View file

@ -55,6 +55,7 @@ module.exports = React.createClass({
flows: PropTypes.arrayOf(PropTypes.object).isRequired,
serverConfig: PropTypes.instanceOf(ValidatedServerConfig).isRequired,
canSubmit: PropTypes.bool,
serverCapabilities: PropTypes.object,
},
getDefaultProps: function() {
@ -436,8 +437,9 @@ module.exports = React.createClass({
},
_showEmail() {
const idServerRequired = !this.props.serverCapabilities['me.dbkr.idomyownemail'];
const haveIs = Boolean(this.props.serverConfig.isUrl);
if (!haveIs || !this._authStepIsUsed('m.login.email.identity')) {
if ((idServerRequired && !haveIs) || !this._authStepIsUsed('m.login.email.identity')) {
return false;
}
return true;