From 477a1fb5bc5d3ff272f7685dff9c8378aa9f39cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Thu, 28 Apr 2016 15:18:09 +0100 Subject: [PATCH] Fixes sync error when transfering credentials from legacy to API key --- 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 index aeb768f715..0d7b3b769a 100644 --- 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 ""; })