Fix the public key using the wrong domain in settings

pull/1/head
yflory 7 years ago
parent a96e49d55a
commit 2813b7219e

@ -34,8 +34,8 @@ define([
var getFileHashFromKeys = Hash.getFileHashFromKeys = function (fileKey, cryptKey) { var getFileHashFromKeys = Hash.getFileHashFromKeys = function (fileKey, cryptKey) {
return '/1/' + hexToBase64(fileKey) + '/' + Crypto.b64RemoveSlashes(cryptKey) + '/'; return '/1/' + hexToBase64(fileKey) + '/' + Crypto.b64RemoveSlashes(cryptKey) + '/';
}; };
Hash.getUserHrefFromKeys = function (username, pubkey) { Hash.getUserHrefFromKeys = function (origin, username, pubkey) {
return window.location.origin + '/user/#/1/' + username + '/' + pubkey.replace(/\//g, '-'); return origin + '/user/#/1/' + username + '/' + pubkey.replace(/\//g, '-');
}; };
var fixDuplicateSlashes = function (s) { var fixDuplicateSlashes = function (s) {

@ -68,7 +68,7 @@ define([
var publicKey = privateData.edPublic; var publicKey = privateData.edPublic;
if (publicKey) { if (publicKey) {
var $key = $('<div>', {'class': 'cp-sidebarlayout-element'}).appendTo($div); var $key = $('<div>', {'class': 'cp-sidebarlayout-element'}).appendTo($div);
var userHref = Hash.getUserHrefFromKeys(accountName, publicKey); var userHref = Hash.getUserHrefFromKeys(privateData.origin, accountName, publicKey);
var $pubLabel = $('<span>', {'class': 'label'}) var $pubLabel = $('<span>', {'class': 'label'})
.text(Messages.settings_publicSigningKey); .text(Messages.settings_publicSigningKey);
$key.append($pubLabel).append(UI.dialog.selectable(userHref)); $key.append($pubLabel).append(UI.dialog.selectable(userHref));

Loading…
Cancel
Save