diff --git a/modules/rnotes/components/folk-notes-app.ts b/modules/rnotes/components/folk-notes-app.ts index 0e0f4ce7..6c65e0f5 100644 --- a/modules/rnotes/components/folk-notes-app.ts +++ b/modules/rnotes/components/folk-notes-app.ts @@ -268,7 +268,12 @@ export class FolkNotesApp extends HTMLElement { this._render(); try { const base = this._getApiBase(); - const res = await fetch(`${base}/api/vault/upload`, { method: 'POST', body: fd }); + const token = localStorage.getItem('encryptid-token'); + const res = await fetch(`${base}/api/vault/upload`, { + method: 'POST', + body: fd, + headers: token ? { 'Authorization': `Bearer ${token}` } : {}, + }); const data = await res.json(); if (res.ok) { this._uploadStatus = `Vault uploaded: ${data.name ?? 'done'}`; @@ -534,7 +539,7 @@ ${this._uploadOpen ? this._renderUploadDialog() : ''}
- +
${escHtml(this._uploadStatus)}