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 () => {
|
export default () => {
|
||||||
return async (req: Request, res: Response, next: NextFunction) => {
|
return async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
const token = req.header("authorization").replace("Bearer ", "");
|
const token = req.header("authorization").replace("Bearer", "").trim();
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return next();
|
return next();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue