Commit 46cce590 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

Workspace: prevent feedback loop on double connect with password ask

parent 54723d62
...@@ -90,6 +90,12 @@ define([ ...@@ -90,6 +90,12 @@ define([
this.on("password_required", connectWithPass.bind(this, "password")); this.on("password_required", connectWithPass.bind(this, "password"));
this.on("passphrase_required", connectWithPass.bind(this, "SSH key passphrase")); this.on("passphrase_required", connectWithPass.bind(this, "SSH key passphrase"));
this.on("stateChanged", function() {
if (this._passwordDialog) {
this._passwordDialog.abort();
}
});
this.on("connecting", function() { this.on("connecting", function() {
this._setState("connecting"); this._setState("connecting");
}); });
...@@ -204,10 +210,6 @@ define([ ...@@ -204,10 +210,6 @@ define([
return; return;
} }
if (this._passwordDialog && state != "disconnected") {
this._passwordDialog.close();
}
this.logger.debug(state); this.logger.debug(state);
var changed = this._state != state; var changed = this._state != state;
...@@ -244,7 +246,7 @@ define([ ...@@ -244,7 +246,7 @@ define([
} }
if (this._state == "disconnected" && !this._passwordDialog) { if (this._state == "disconnected" && !this._passwordDialog) {
this._connect(password || $.cookie("tmpPass") || null); this._connect(password || $.cookie("tmpPass") || null);
$.removeCookie("tmpPass"); $.removeCookie("tmpPass");
} }
}, },
...@@ -290,8 +292,8 @@ define([ ...@@ -290,8 +292,8 @@ define([
var self = this; var self = this;
if (this._state == "disconnected") { if (this._state == "disconnected") {
if (this._passwordDialog) { // abort connecting with pasword if (this._passwordDialog) { // abort connecting with password
this._passwordDialog.close(); this._passwordDialog.abort();
} }
if ($.isFunction(callback)) callback(null); if ($.isFunction(callback)) callback(null);
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment