Compare commits
No commits in common. "3a84cc8ef56c20fce74707f0aa9df7f120ee693e" and "90136af516abc80703b5d7f063aa87c1c1082563" have entirely different histories.
3a84cc8ef5
...
90136af516
4
.prettierrc
Normal file
4
.prettierrc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"tabWidth": 4,
|
||||||
|
"useTabs": false
|
||||||
|
}
|
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"typescript.format.enable": true,
|
|
||||||
"typescript.preferences.quoteStyle": "single",
|
|
||||||
"[json]": {
|
|
||||||
"editor.defaultFormatter": "vscode.json-language-features"
|
|
||||||
},
|
|
||||||
"prettier.enable": false,
|
|
||||||
"[typescript]": {
|
|
||||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
import { Request, Response, NextFunction } from "express";
|
|
||||||
// import bodyParser from 'body-parser';
|
|
||||||
// import cors from 'cors';
|
|
||||||
import * as jwt from "jsonwebtoken";
|
|
||||||
|
|
||||||
export default (req: Request, res: Response, next: NextFunction) => {
|
|
||||||
const token = <string>req.headers["auth"];
|
|
||||||
try {
|
|
||||||
const jwtPayload = <any>jwt.verify(token, "secretjwtsecret");
|
|
||||||
// const jwtPayload = <any>jwt.verify(token, process.env.JWT_SECRET);
|
|
||||||
res.locals.jwtPayload = jwtPayload;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
return res.status(401).send();
|
|
||||||
}
|
|
||||||
next();
|
|
||||||
};
|
|
@ -1,10 +0,0 @@
|
|||||||
import { Router } from "express";
|
|
||||||
import jwtauth from "../../middlewares/jwtauth";
|
|
||||||
|
|
||||||
const router = Router();
|
|
||||||
|
|
||||||
router.use("*", jwtauth, async (req, res, next) => {
|
|
||||||
return res.send("ok");
|
|
||||||
});
|
|
||||||
|
|
||||||
export default router;
|
|
@ -5,8 +5,8 @@
|
|||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"strict": false,
|
"strict": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true
|
"emitDecoratorMetadata":true
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user