Correcting a temp value and adding a fallback for unauthenticated users

This commit is contained in:
Nikola Bjelo committed 2018-10-23 15:50:25 +02:00
1 parent ad421426d5
commit 796338539f
1 file changed
+3 -1
+3 -1
View File
@@ -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()
}
})