summaryrefslogtreecommitdiffstats
path: root/backend/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'backend/src/index.js')
-rw-r--r--backend/src/index.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/backend/src/index.js b/backend/src/index.js
index 86bba16..94911ec 100644
--- a/backend/src/index.js
+++ b/backend/src/index.js
@@ -3,6 +3,7 @@ require('dotenv').config({ path: 'variables.env' });
/* eslint-enable */
const jwt = require('jsonwebtoken');
const createServer = require('./createServer');
+const db = require('./db');
const cookieParser = require('cookie-parser');
const server = createServer();
@@ -21,9 +22,7 @@ server.express.use((req, res, next) => {
// 2. Get User from their ID
server.express.use(async (req, res, next) => {
if (!req.userId) return next();
- const user = await server
- .context()
- .db.query.user({ where: { id: req.userId } }, `{ id, permissions, email, name }`);
+ const user = await db.query.user({ where: { id: req.userId } }, `{ id, permissions, email, name }`);
req.user = user;
next();
});