diff options
Diffstat (limited to 'src/middleware.ts')
| -rw-r--r-- | src/middleware.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/middleware.ts b/src/middleware.ts index 8239121..46d6e00 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -4,6 +4,7 @@ import got from "got"; import jwt from "jsonwebtoken"; import { getPermittedUsers } from "./db"; +import config from "./config"; const tgAuth = async (ctx: Context, next: () => Promise<void>): Promise<void> => { const userId = ctx.message?.from.id; @@ -19,6 +20,11 @@ const tgAuth = async (ctx: Context, next: () => Promise<void>): Promise<void> => }; const verifyGoogleJWT = async (req: Request, res: Response, next: () => void): Promise<void> => { + if (config.nodeEnv !== "production") { + next(); + return; + } + const authHeader = req.headers.authorization || null; if (!authHeader) { res.sendStatus(401); |
