Skip to content

Commit a8c7664

Browse files
oetikerodeimaiz
authored andcommitted
Better password save (ITISFoundation#329)
* properly trigger the password save popup
1 parent ff0ac55 commit a8c7664

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ matrix:
33
- language: node_js
44
node_js:
55
- "8"
6+
7+
cache:
8+
directories:
9+
- .npm
10+
611
install:
712
- npm install -g npm@latest
813
- npm install --save-dev eslint

services/web/client/source/class/qxapp/auth/core/BaseAuthPage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ qx.Class.define("qxapp.auth.core.BaseAuthPage", {
2727
// outside a form, so lets accomodate him
2828
this.addListenerOnce("appear", e => {
2929
let el = this.getContentElement();
30-
let form = this._form = new qx.html.Element("form", null, {
30+
let form = this._formElement = new qx.html.Element("form", null, {
3131
name: "fakeLoginform",
3232
autocomplete: "on"
3333
});
@@ -58,7 +58,7 @@ qx.Class.define("qxapp.auth.core.BaseAuthPage", {
5858
* when all is said and done we should remove the form so that the password manager
5959
* knows to save the content of the form. so we save it here.
6060
*/
61-
_form: null,
61+
_formElement: null,
6262
/**
6363
* This method gets called upon construction and
6464
* must be overriden in a subclass

services/web/client/source/class/qxapp/auth/ui/LoginPage.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ qx.Class.define("qxapp.auth.ui.LoginPage", {
3131
*/
3232

3333
members: {
34-
__form: null,
35-
3634
// overrides base
35+
__form: null,
3736
_buildPage: function() {
3837
this.__form = new qx.ui.form.Form();
3938

@@ -137,9 +136,10 @@ qx.Class.define("qxapp.auth.ui.LoginPage", {
137136

138137
let successFun = function(log) {
139138
this.fireDataEvent("done", log.message);
140-
// we don't need the form any more, so remove it
139+
// we don't need the form any more, so remove it and mock-navigate-away
141140
// and thus tell the password manager to save the content
142-
this._form.dispose();
141+
this._formElement.dispose();
142+
window.history.replaceState(null, window.document.title, window.location.pathname);
143143
};
144144

145145
let failFun = function(msg) {

0 commit comments

Comments
 (0)