From 5213e86ab3cbeb10bbef6faadadced8c340aa82d Mon Sep 17 00:00:00 2001 From: IrosTheBeggar Date: Mon, 10 May 2021 20:14:12 -0400 Subject: [PATCH] notes --- src/api/federation.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/federation.js b/src/api/federation.js index 04e0f46..4144e1c 100644 --- a/src/api/federation.js +++ b/src/api/federation.js @@ -247,7 +247,9 @@ exports.setup = (mstream) => { mstream.get('/api/v1/syncthing-proxy/*', (req, res) => { try { + // Add the auth token as a cookie so all contents of the iframe use it res.cookie('x-access-token', req.token); + // TODO: This can crash the program if the target is incorrect apiProxy.web(req, res, {target: 'http://' + sync.getUiAddress()}); } catch (err) { winston.error('Syncthing Proxy Error', { stack: err }); @@ -257,6 +259,7 @@ exports.setup = (mstream) => { mstream.get('/api/v1/syncthing-proxy/', (req, res) => { try { + // Add the auth token as a cookie so all contents of the iframe use it res.cookie('x-access-token', req.token); apiProxy.web(req, res, {target: 'http://' + sync.getUiAddress()}); } catch (err) {