Merge pull request #3421 from matrix-org/t3chguy/nvl/fix_sso_flash

Hide the change HS url button on SSO login flow if custom urls disabled
This commit is contained in:
Michael Telatynski 2019-09-12 12:29:03 +01:00 committed by GitHub
commit d7bac95270
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -567,6 +567,12 @@ module.exports = createReactClass({
_renderSsoStep: function(url) { _renderSsoStep: function(url) {
const SignInToText = sdk.getComponent('views.auth.SignInToText'); const SignInToText = sdk.getComponent('views.auth.SignInToText');
let onEditServerDetailsClick = null;
// If custom URLs are allowed, wire up the server details edit link.
if (PHASES_ENABLED && !SdkConfig.get()['disable_custom_urls']) {
onEditServerDetailsClick = this.onEditServerDetailsClick;
}
// XXX: This link does *not* have a target="_blank" because single sign-on relies on // XXX: This link does *not* have a target="_blank" because single sign-on relies on
// redirecting the user back to a URI once they're logged in. On the web, this means // redirecting the user back to a URI once they're logged in. On the web, this means
// we use the same window and redirect back to riot. On electron, this actually // we use the same window and redirect back to riot. On electron, this actually
@ -578,7 +584,7 @@ module.exports = createReactClass({
return ( return (
<div> <div>
<SignInToText serverConfig={this.props.serverConfig} <SignInToText serverConfig={this.props.serverConfig}
onEditServerDetailsClick={this.onEditServerDetailsClick} /> onEditServerDetailsClick={onEditServerDetailsClick} />
<a href={url} className="mx_Login_sso_link mx_Login_submit">{ _t('Sign in with single sign-on') }</a> <a href={url} className="mx_Login_sso_link mx_Login_submit">{ _t('Sign in with single sign-on') }</a>
</div> </div>