diff --git a/src/public/javascripts/export.js b/src/public/javascripts/export.js index 33b498b99..68fb053e4 100644 --- a/src/public/javascripts/export.js +++ b/src/public/javascripts/export.js @@ -1,7 +1,8 @@ "use strict"; function exportSubTree(noteId) { - const url = getHost() + "/api/export/" + noteId; + const url = getHost() + "/api/export/" + noteId + "?protectedSessionId=" + + encodeURIComponent(protected_session.getProtectedSessionId()); download(url); } diff --git a/src/routes/api/export.js b/src/routes/api/export.js index 47b241361..49bb74fc5 100644 --- a/src/routes/api/export.js +++ b/src/routes/api/export.js @@ -10,7 +10,7 @@ const wrap = require('express-promise-wrap').wrap; const tar = require('tar-stream'); const sanitize = require("sanitize-filename"); -router.get('/:noteId/', auth.checkApiAuth, wrap(async (req, res, next) => { +router.get('/:noteId/', auth.checkApiAuthOrElectron, wrap(async (req, res, next) => { const noteId = req.params.noteId; const noteTreeId = await sql.getValue('SELECT noteTreeId FROM note_tree WHERE noteId = ?', [noteId]);