nextcloud / whiteboard

GNU Affero General Public License v3.0
2 stars 0 forks source link

Public sharing #53

Open juliushaertl opened 3 weeks ago

juliushaertl commented 3 weeks ago

We need to support collaboration on public share links. For that our jwt token logic needs to be extended to be able to handle share tokens properly

juliushaertl commented 3 days ago

Links to code pointers as shown in the call:

https://github.com/nextcloud/text/blob/74aa530fb4ca922d3577b64cc01676d28c449988/lib/Service/DocumentService.php#L531 https://github.com/nextcloud/text/blob/f4685419a20404cae672bbfb074353b7e2611982/lib/Service/ApiService.php#L52

On the frontend the share token can be obtained through the viewer component props, something like that should work:

diff --git a/src/main.tsx b/src/main.tsx
index 1c07ff9..84aa203 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -51,6 +51,10 @@ const Component = {
                        type: Boolean,
                        default: false,
                },
+               shareToken: {
+                       type: String,
+                       default: () => document.getElementById('sharingToken')?.value ?? null
+               },
        },
        data() {
                return {