Merge pull request #2775 from matrix-org/travis/auth-escape-hatch

Provide an escape from the registration process
pull/21833/head
Travis Ralston 2019-03-12 10:56:49 -06:00 committed by GitHub
commit 09600dcabd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -366,6 +366,17 @@ module.exports = React.createClass({
this.props.onLoginClick();
},
onGoToFormClicked(ev) {
ev.preventDefault();
ev.stopPropagation();
this._replaceClient();
this.setState({
busy: false,
doingUIAuth: false,
phase: PHASE_REGISTRATION,
});
},
onServerDetailsNextPhaseClick(ev) {
ev.stopPropagation();
this.setState({
@ -549,6 +560,14 @@ module.exports = React.createClass({
{ _t('Sign in instead') }
</a>;
// Only show the 'go back' button if you're not looking at the form
let goBack;
if ((PHASES_ENABLED && this.state.phase !== PHASE_REGISTRATION) || this.state.doingUIAuth) {
goBack = <a className="mx_AuthBody_changeFlow" onClick={this.onGoToFormClicked} href="#">
{ _t('Go back') }
</a>;
}
return (
<AuthPage>
<AuthHeader />
@ -557,6 +576,7 @@ module.exports = React.createClass({
{ errorText }
{ this.renderServerComponent() }
{ this.renderRegisterComponent() }
{ goBack }
{ signIn }
</AuthBody>
</AuthPage>