Merge pull request #4165 from matrix-org/jryans/lock-auth-success
Lock login and registration buttons after submitpull/21833/head
commit
ffde56d804
|
@ -161,6 +161,7 @@ export default createReactClass({
|
||||||
_authStateUpdated: function(stageType, stageState) {
|
_authStateUpdated: function(stageType, stageState) {
|
||||||
const oldStage = this.state.authStage;
|
const oldStage = this.state.authStage;
|
||||||
this.setState({
|
this.setState({
|
||||||
|
busy: false,
|
||||||
authStage: stageType,
|
authStage: stageType,
|
||||||
stageState: stageState,
|
stageState: stageState,
|
||||||
errorText: stageState.error,
|
errorText: stageState.error,
|
||||||
|
@ -184,11 +185,13 @@ export default createReactClass({
|
||||||
errorText: null,
|
errorText: null,
|
||||||
stageErrorText: null,
|
stageErrorText: null,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
busy: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
// The JS SDK eagerly reports itself as "not busy" right after any
|
||||||
|
// immediate work has completed, but that's not really what we want at
|
||||||
|
// the UI layer, so we ignore this signal and show a spinner until
|
||||||
|
// there's a new screen to show the user. This is implemented by setting
|
||||||
|
// `busy: false` in `_authStateUpdated`.
|
||||||
|
// See also https://github.com/vector-im/riot-web/issues/12546
|
||||||
},
|
},
|
||||||
|
|
||||||
_setFocus: function() {
|
_setFocus: function() {
|
||||||
|
|
|
@ -245,6 +245,7 @@ export default createReactClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
busy: false,
|
||||||
errorText: errorText,
|
errorText: errorText,
|
||||||
// 401 would be the sensible status code for 'incorrect password'
|
// 401 would be the sensible status code for 'incorrect password'
|
||||||
// but the login API gives a 403 https://matrix.org/jira/browse/SYN-744
|
// but the login API gives a 403 https://matrix.org/jira/browse/SYN-744
|
||||||
|
@ -252,13 +253,6 @@ export default createReactClass({
|
||||||
// We treat both as an incorrect password
|
// We treat both as an incorrect password
|
||||||
loginIncorrect: error.httpStatus === 401 || error.httpStatus === 403,
|
loginIncorrect: error.httpStatus === 401 || error.httpStatus === 403,
|
||||||
});
|
});
|
||||||
}).finally(() => {
|
|
||||||
if (this._unmounted) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setState({
|
|
||||||
busy: false,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue