From 2c5c47e3c5343419a6efa618b9d6549394da2e9f Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 19 Apr 2021 15:29:33 +0300 Subject: Fix date logic --- src/middleware.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/middleware.ts') 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): Promise => { const userId = ctx.message?.from.id; @@ -19,6 +20,11 @@ const tgAuth = async (ctx: Context, next: () => Promise): Promise => }; const verifyGoogleJWT = async (req: Request, res: Response, next: () => void): Promise => { + if (config.nodeEnv !== "production") { + next(); + return; + } + const authHeader = req.headers.authorization || null; if (!authHeader) { res.sendStatus(401); -- cgit v1.3