diff options
author | Guillaume Viguier <guillaume@viguierjust.com> | 2018-09-20 16:26:12 +0300 |
---|---|---|
committer | Guillaume Viguier <guillaume@viguierjust.com> | 2018-09-20 16:26:12 +0300 |
commit | a6fcdd504e13ee00090a3a89f48d1ba774b0b0ef (patch) | |
tree | d82170b39a73b5a65b2c7b31edc3e84c3fb10c71 | |
parent | 278431675ebd0228816c66afa0c0ce6f2e0c9285 (diff) |
Password issues
-rw-r--r-- | src/components/nsNextcloud.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/nsNextcloud.js b/src/components/nsNextcloud.js index dc89515..39013f3 100644 --- a/src/components/nsNextcloud.js +++ b/src/components/nsNextcloud.js @@ -361,8 +361,13 @@ Nextcloud.prototype = { this.log.info("Suppressing password prompt"); } - let passwordURI = this._serverUrl; - let logins = Services.logins.findLogins({}, passwordURI, null, passwordURI); + let passwordRealm = this._serverUrl; + let passwordHostname = this._serverUrl; + const thirdSlash = this._serverUrl.indexOf('/', 9); + if (thirdSlash !== -1) { + passwordHostname = this._serverUrl.slice(0, thirdSlash); + } + let logins = Services.logins.findLogins({}, passwordHostname, null, passwordRealm); for (let loginInfo of logins) { if (loginInfo.username == aUsername) { return loginInfo.password; |