commit 477a1fb5bc5d3ff272f7685dff9c8378aa9f39cb parent 186561f3202e31cb22aabefe85363a7667732653 Author: Adomas VenĨkauskas <adomas.ven@gmail.com> Date: Thu, 28 Apr 2016 15:18:09 +0100 Fixes sync error when transfering credentials from legacy to API key Diffstat:
| M | chrome/content/zotero/xpcom/sync/syncRunner.js | | | 7 | +++---- |
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/xpcom/sync/syncRunner.js b/chrome/content/zotero/xpcom/sync/syncRunner.js @@ -1278,12 +1278,11 @@ Zotero.Sync.Runner_Module = function (options = {}) { // Set in login manager || Zotero.Sync.Data.Local.getAPIKey() // Fallback to old username/password - || (yield _getAPIKeyFromLogin()); + || _getAPIKeyFromLogin(); }) var _getAPIKeyFromLogin = Zotero.Promise.coroutine(function* () { - var apiKey; let username = Zotero.Prefs.get('sync.server.username'); if (username) { // Check for legacy password if no password set in current session @@ -1293,9 +1292,9 @@ Zotero.Sync.Runner_Module = function (options = {}) { return ""; } - apiKey = yield Zotero.Sync.Runner.createAPIKeyFromCredentials(username, password); + let json = yield Zotero.Sync.Runner.createAPIKeyFromCredentials(username, password); Zotero.Sync.Data.Local.removeLegacyLogins(); - return apiKey; + return json.key; } return ""; })