Skip to content

Commit 834bb13

Browse files
committed
one err cleared
Signed-off-by: Tanmay Vaij <[email protected]>
1 parent b07ed01 commit 834bb13

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Diff for: src/middlewares/tokenVerifier.middleware.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ export const tokenVerifier = (
1313
req: Request,
1414
res: Response,
1515
next: NextFunction
16-
) => {
16+
): void => {
1717
try {
1818
const authHeader = req.headers.authorization;
1919

20-
if (!authHeader)
21-
return res.json({
20+
if (!authHeader){
21+
res.json({
2222
err: "authorization token was not provided",
2323
isSuccess: false,
2424
});
25+
return
26+
}
2527

2628
const token = authHeader!.split(" ")[1];
2729

@@ -32,6 +34,6 @@ export const tokenVerifier = (
3234

3335
next();
3436
} catch (err) {
35-
return res.json({ isSucess: false, err });
37+
res.json({ isSucess: false, err });
3638
}
3739
};

Diff for: tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
5050
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
5151
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52-
// "outDir": "./", /* Specify an output folder for all emitted files. */
52+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
5353
// "removeComments": true, /* Disable emitting comments. */
5454
// "noEmit": true, /* Disable emitting files from a compilation. */
5555
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */

0 commit comments

Comments
 (0)