Skip to content

Commit

Permalink
fix: get current token auth middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
masb0ymas committed Oct 20, 2020
1 parent bfd3731 commit 724c3e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/middlewares/Authorization.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// eslint-disable-next-line no-unused-vars
import { NextFunction, Request, Response } from 'express'
import { verifyToken } from 'helpers/Token'
import { currentToken, verifyToken } from 'helpers/Token'
import { isEmpty } from 'lodash'

async function Authorization(req: Request, res: Response, next: NextFunction) {
const token = verifyToken(req.getHeaders())
const getToken = currentToken(req)
const token = verifyToken(getToken)

if (isEmpty(token?.data)) {
return res.status(401).json({
Expand Down

0 comments on commit 724c3e0

Please sign in to comment.