diff --git a/src/components/structures/InteractiveAuth.js b/src/components/structures/InteractiveAuth.js
index 205d2ca1b8..c29b0fe16a 100644
--- a/src/components/structures/InteractiveAuth.js
+++ b/src/components/structures/InteractiveAuth.js
@@ -125,6 +125,7 @@ export default React.createClass({
stageParams={this._authLogic.getStageParams(stage)}
submitAuthDict={this._submitAuthDict}
errorText={this.state.stageErrorText}
+ busy={this.state.busy}
/>
);
},
diff --git a/src/components/views/login/InteractiveAuthEntryComponents.js b/src/components/views/login/InteractiveAuthEntryComponents.js
index e4c48b1b1b..4759a30c88 100644
--- a/src/components/views/login/InteractiveAuthEntryComponents.js
+++ b/src/components/views/login/InteractiveAuthEntryComponents.js
@@ -49,11 +49,14 @@ export const PasswordAuthEntry = React.createClass({
propTypes: {
submitAuthDict: React.PropTypes.func.isRequired,
errorText: React.PropTypes.string,
+ // is the auth logic currently waiting for something to
+ // happen?
+ busy: React.PropTypes.bool,
},
getInitialState: function() {
return {
- enableSubmit: false,
+ passwordValid: false,
};
},
@@ -63,7 +66,10 @@ export const PasswordAuthEntry = React.createClass({
}
},
- _onSubmit: function() {
+ _onSubmit: function(e) {
+ e.preventDefault();
+ if (this.props.busy) return;
+
this.props.submitAuthDict({
type: PasswordAuthEntry.LOGIN_TYPE,
user: MatrixClientPeg.get().credentials.userId,
@@ -74,7 +80,7 @@ export const PasswordAuthEntry = React.createClass({
_onPasswordFieldChange: function(ev) {
// enable the submit button iff the password is non-empty
this.setState({
- enableSubmit: Boolean(this.refs.passwordField.value),
+ passwordValid: Boolean(this.refs.passwordField.value),
});
},
@@ -85,6 +91,19 @@ export const PasswordAuthEntry = React.createClass({
passwordBoxClass = 'error';
}
+ let submitButtonOrSpinner;
+ if (this.props.busy) {
+ const Loader = sdk.getComponent("elements.Spinner");
+ submitButtonOrSpinner =
To continue, please enter your password.
@@ -97,10 +116,7 @@ export const PasswordAuthEntry = React.createClass({ type="password" />