From 796338539fbd9da533affa477a9bd821656f3978 Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Tue, 23 Oct 2018 15:50:25 +0200 Subject: [PATCH] Correcting a temp value and adding a fallback for unauthenticated users --- server/src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/index.js b/server/src/index.js index bad6aaced..60b1111b2 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -94,7 +94,7 @@ async function run () { ) app.use('/graphql', (req, res, next) => { - res.locals.userId = 'haha' + res.locals.userId = '' if (req.user) { getUserId(req.user.sub) .then(data => { @@ -105,6 +105,8 @@ async function run () { res.locals.error = err next() }) + } else { + next() } })