diff --git a/chrome/content/zotero/preferences/preferences_sync.js b/chrome/content/zotero/preferences/preferences_sync.js index c37c3b9277..4b454697eb 100644 --- a/chrome/content/zotero/preferences/preferences_sync.js +++ b/chrome/content/zotero/preferences/preferences_sync.js @@ -151,6 +151,7 @@ Zotero_Preferences.Sync = { unverifyStorageServer: function () { Zotero.Prefs.set('sync.storage.verified', false); + Zotero.Sync.Storage.WebDAV.clearCachedCredentials(); Zotero.Sync.Storage.resetAllSyncStates(null, true, false); }, diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index 4ea0593108..55f104bb06 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -827,6 +827,11 @@ Zotero.Sync.Storage.WebDAV = (function () { _rootURI = uri; }; + + obj.clearCachedCredentials = function() { + _rootURI = _parentURI = undefined; + _cachedCredentials = false; + }; /** * Begin download process for individual file diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index 8428740145..de4bb40f04 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -675,7 +675,7 @@ Zotero.Sync.Storage.ZFS = (function () { }); - obj._init = function (url, username, password) { + obj._init = function () { _rootURI = false; _userURI = false; @@ -695,6 +695,10 @@ Zotero.Sync.Storage.ZFS = (function () { _userURI = uri; }; + obj.clearCachedCredentials = function() { + _rootURI = _userURI = undefined; + _cachedCredentials = false; + }; /** * Begin download process for individual file diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 3eb0699ef9..4f0901d1d0 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1277,6 +1277,9 @@ Zotero.Sync.Server = new function () { break; } + // Clear password for file sync + Zotero.Sync.Storage.ZFS.clearCachedCredentials(); + _cachedCredentials = {}; var username = this.username;