Skip to content
Snippets Groups Projects
Commit e8f80c07 authored by Bernard Roland (Student Com20)'s avatar Bernard Roland (Student Com20)
Browse files

Merge branch 'deployment' into devel

parents 046989e3 713f2311
No related branches found
No related tags found
No related merge requests found
......@@ -8,12 +8,14 @@
"private": true,
"main": "server/build.js",
"scripts": {
"install": "cd server && yarn install --production=false && cd ../client && yarn install --production=false",
"install": "cd server && yarn install --production=false && cd ../client && yarn install --production=false",
"build": "cd server && yarn build && cd ../client && yarn build",
"start": "cd server && node build/index.js"
},
"keywords": [ ],
"dependencies": { },
"keywords": [],
"dependencies": {
"yarn": "^1.22.10"
},
"engines": {
"node": "16.x"
}
......
......@@ -38,7 +38,14 @@ export async function tokenVerification(req: Request, _res: Response, next: Next
decoded = await asyncify(verify, token, getSecret(), { algorithms: ["HS384"] });
}
if (isOfType<Token>(decoded, [['id', 'string'], ['type', 'string']]) && decoded.type === authTokenType) {
req.body.token = decoded;
const user = await database('users')
.select({ id: 'users.id' })
.where({
'users.id': decoded.id,
});
if (user.length >= 1) {
req.body.token = decoded;
}
}
} catch (err) { /* Token has already been deleted */ }
next();
......
......@@ -2,3 +2,7 @@
# yarn lockfile v1
yarn@^1.22.10:
version "1.22.10"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.10.tgz#c99daa06257c80f8fa2c3f1490724e394c26b18c"
integrity sha512-IanQGI9RRPAN87VGTF7zs2uxkSyQSrSPsju0COgbsKQOOXr5LtcVPeyXWgwVa0ywG3d8dg6kSYKGBuYK021qeA==
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment