Skip to content

Commit fb08167

Browse files
committed
use your home server's link host for secret links
This means links have the corect host when created/viewed from localhost
1 parent 7157402 commit fb08167

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/components/drive/DriveShare.vue

+5
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
v-on:hide-modal="closeSecretLinkModal"
155155
:title="modalTitle"
156156
:link="modalLink"
157+
:host="this.linkHost"
157158
:existingProps="existingProps"
158159
:username="this.context.username"
159160
/>
@@ -225,6 +226,7 @@ module.exports = {
225226
choice_options: [],
226227
existingProps:null,
227228
secretLinksList: [],
229+
linkHost: "",
228230
};
229231
},
230232
props: [
@@ -254,6 +256,9 @@ module.exports = {
254256
methods: {
255257
loadSecretLinks() {
256258
let that = this;
259+
this.context.getLinkHost().thenApply(host => {
260+
that.linkHost = host;
261+
});
257262
this.showSpinner = true;
258263
let file = this.files[0];
259264
let props = file.getFileProperties();

src/components/drive/SecretLink.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ module.exports = {
156156
"link",
157157
"username",
158158
"existingProps",
159+
"host"
159160
],
160161
created: function() {
161162
let that = this;
@@ -198,7 +199,7 @@ module.exports = {
198199
args += "&args=%7B%22filename%22:%22" + link.filename + "%22%7D";
199200
}
200201
}
201-
let href = window.location.origin + "/" + this.baseUrl + args;
202+
let href = this.host + "/" + this.baseUrl + args;
202203
let secretLinkQrCode = peergos.shared.SecretLinkQRCode.generate(href);
203204
this.base64QrCode = secretLinkQrCode.getBase64Thumbnail();
204205
return href;

0 commit comments

Comments
 (0)