Skip to content

Commit

Permalink
fix: make next required to avoid missing coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Oct 27, 2023
1 parent 98a7e55 commit e1e5814
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const jwt = ({
responseHeaderName = 'X-Token',
getToken = getTokenFromHeader
}: JwtMwProps) => {
return function (req: RequestWithUser, res: ServerResponse, next?: () => void) {
return function (req: RequestWithUser, res: ServerResponse, next: () => void) {
const token: string = getToken((req.headers[requestHeaderName] as string) ?? '')

try {
Expand All @@ -56,9 +56,9 @@ export const jwt = ({
algorithm
})
)
next?.()
next()
} catch {
next?.()
next()
}
}
}

0 comments on commit e1e5814

Please sign in to comment.