diff options
-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; |