Merge pull request #3319 from matrix-org/dbkr/allow_pw_reset_no_is
Allow password reset without an ID Server
This commit is contained in:
commit
cd26b73386
2 changed files with 16 additions and 3 deletions
|
@ -36,7 +36,11 @@ class PasswordReset {
|
||||||
idBaseUrl: identityUrl,
|
idBaseUrl: identityUrl,
|
||||||
});
|
});
|
||||||
this.clientSecret = this.client.generateClientSecret();
|
this.clientSecret = this.client.generateClientSecret();
|
||||||
this.identityServerDomain = identityUrl.split("://")[1];
|
this.identityServerDomain = identityUrl ? identityUrl.split("://")[1] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
doesServerRequireIdServerParam() {
|
||||||
|
return this.client.doesServerRequireIdServerParam();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -62,10 +62,12 @@ module.exports = React.createClass({
|
||||||
serverIsAlive: true,
|
serverIsAlive: true,
|
||||||
serverErrorIsFatal: false,
|
serverErrorIsFatal: false,
|
||||||
serverDeadError: "",
|
serverDeadError: "",
|
||||||
|
serverRequiresIdServer: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
|
this.reset = null;
|
||||||
this._checkServerLiveliness(this.props.serverConfig);
|
this._checkServerLiveliness(this.props.serverConfig);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -83,7 +85,14 @@ module.exports = React.createClass({
|
||||||
serverConfig.hsUrl,
|
serverConfig.hsUrl,
|
||||||
serverConfig.isUrl,
|
serverConfig.isUrl,
|
||||||
);
|
);
|
||||||
this.setState({serverIsAlive: true});
|
|
||||||
|
const pwReset = new PasswordReset(serverConfig.hsUrl, serverConfig.isUrl);
|
||||||
|
const serverRequiresIdServer = await pwReset.doesServerRequireIdServerParam();
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
serverIsAlive: true,
|
||||||
|
serverRequiresIdServer,
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.setState(AutoDiscoveryUtils.authComponentStateForError(e, "forgot_password"));
|
this.setState(AutoDiscoveryUtils.authComponentStateForError(e, "forgot_password"));
|
||||||
}
|
}
|
||||||
|
@ -256,7 +265,7 @@ module.exports = React.createClass({
|
||||||
</a>;
|
</a>;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.props.serverConfig.isUrl) {
|
if (!this.props.serverConfig.isUrl && this.state.serverRequiresIdServer) {
|
||||||
return <div>
|
return <div>
|
||||||
<h3>
|
<h3>
|
||||||
{yourMatrixAccountText}
|
{yourMatrixAccountText}
|
||||||
|
|
Loading…
Reference in a new issue