From 2813b7219e500c3a1377a69cf505851c33b23bd4 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 16 Nov 2017 13:35:07 +0100 Subject: [PATCH] Fix the public key using the wrong domain in settings --- www/common/common-hash.js | 4 ++-- www/settings/inner.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/common/common-hash.js b/www/common/common-hash.js index c40919aa1..ff966eed0 100644 --- a/www/common/common-hash.js +++ b/www/common/common-hash.js @@ -34,8 +34,8 @@ define([ var getFileHashFromKeys = Hash.getFileHashFromKeys = function (fileKey, cryptKey) { return '/1/' + hexToBase64(fileKey) + '/' + Crypto.b64RemoveSlashes(cryptKey) + '/'; }; - Hash.getUserHrefFromKeys = function (username, pubkey) { - return window.location.origin + '/user/#/1/' + username + '/' + pubkey.replace(/\//g, '-'); + Hash.getUserHrefFromKeys = function (origin, username, pubkey) { + return origin + '/user/#/1/' + username + '/' + pubkey.replace(/\//g, '-'); }; var fixDuplicateSlashes = function (s) { diff --git a/www/settings/inner.js b/www/settings/inner.js index 1774e3c4d..e3798ad15 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -68,7 +68,7 @@ define([ var publicKey = privateData.edPublic; if (publicKey) { var $key = $('
', {'class': 'cp-sidebarlayout-element'}).appendTo($div); - var userHref = Hash.getUserHrefFromKeys(accountName, publicKey); + var userHref = Hash.getUserHrefFromKeys(privateData.origin, accountName, publicKey); var $pubLabel = $('', {'class': 'label'}) .text(Messages.settings_publicSigningKey); $key.append($pubLabel).append(UI.dialog.selectable(userHref));