Skip to content

Commit 724c3e0

Browse files
committed
fix: get current token auth middleware
1 parent bfd3731 commit 724c3e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/middlewares/Authorization.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// eslint-disable-next-line no-unused-vars
22
import { NextFunction, Request, Response } from 'express'
3-
import { verifyToken } from 'helpers/Token'
3+
import { currentToken, verifyToken } from 'helpers/Token'
44
import { isEmpty } from 'lodash'
55

66
async function Authorization(req: Request, res: Response, next: NextFunction) {
7-
const token = verifyToken(req.getHeaders())
7+
const getToken = currentToken(req)
8+
const token = verifyToken(getToken)
89

910
if (isEmpty(token?.data)) {
1011
return res.status(401).json({

0 commit comments

Comments
 (0)