diff --git a/changelog/unreleased/meshdir-add-invite-to-links.md b/changelog/unreleased/meshdir-add-invite-to-links.md new file mode 100644 index 0000000000..6fdc7da9a3 --- /dev/null +++ b/changelog/unreleased/meshdir-add-invite-to-links.md @@ -0,0 +1,8 @@ +Enhancement: Enable forwarding of share invites to the provider selected in meshdirectory + +Added a share invite forward OCM endpoint to the provider links (generated when a user +picks a target provider in the meshdirectory service web interface), together with an +invitation token and originating provider domain passed to the service via query params. + +https://github.com/cs3org/reva/pull/1000 +https://github.com/sciencemesh/sciencemesh/issues/139 diff --git a/examples/meshdirectory/static/index.html b/examples/meshdirectory/static/index.html index 10de5d71e9..7f700d7f91 100644 --- a/examples/meshdirectory/static/index.html +++ b/examples/meshdirectory/static/index.html @@ -76,12 +76,14 @@
Service description:
}, methods: { providerLink(provider) { - const query = this.queryParams.toString() ? `?${this.queryParams}` : '' - return `${this.ocmService(provider).endpoint.path}${query}` + const query = this.queryParams.toString() ? `?${this.queryParams}` : ''; + // TODO(mirekys): sanitize possible double slash + const inviteApi = `${this.ocmService(provider).endpoint.path}/invites/forward`; + return `${inviteApi}${query}`; }, ocmService(provider) { return provider.services.find(s => { - return s.endpoint.type.name === 'OCM' + return s.endpoint.type.name === 'OCM'; }) } }, @@ -92,7 +94,7 @@
Service description:
}) }, baseUrl: function () { - return `${window.location.href}` + return `${window.location.pathname}`; }, queryParams: function () { return new URLSearchParams(window.location.search); @@ -105,7 +107,7 @@
Service description:
this.providers = response.data; }) .catch(err => { - console.log(err) + console.log(err); }); } });