Cleaner logic
This commit is contained in:
parent
303b3cf303
commit
d0935e190c
1 changed files with 1 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ import { LOGGER } from "../util/Logger";
|
|||
export default () => {
|
||||
return async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const token = req.header("authorization").replace("Bearer ", "");
|
||||
const token = req.header("authorization").replace("Bearer", "").trim();
|
||||
|
||||
if (!token) {
|
||||
return next();
|
||||
|
|
|
|||
Loading…
Reference in a new issue