diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index f81ade8..8053462 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: [self-hosted, Linux, X64] + runs-on: [self-hosted, Linux, X64, marquinhos] strategy: matrix: diff --git a/src/middlewares/botAuth.ts b/src/middlewares/botAuth.ts index 6b36878..7ef0a5f 100644 --- a/src/middlewares/botAuth.ts +++ b/src/middlewares/botAuth.ts @@ -1,7 +1,13 @@ import { Request, Response, NextFunction } from 'express'; +import { verifyDiscordToken } from './userAuth'; export function checkToken(req: Request, res: Response, next: NextFunction) { const authorization = req.headers['authorization'] as string; + const isWebRequest = req.headers['marquinhos-agent'] === 'web'; + if (isWebRequest) { + return verifyDiscordToken(req, res, next); + } + console.log(req.headers); const token = authorization && authorization.split(' ')[1]; if (!token) { return res.status(401).json({ message: 'Token not provided' });