From 4c783673af8de3acdf5d06267c512656d5e5440d Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Tue, 20 Jun 2023 16:39:45 -0400 Subject: [PATCH] fix(striker-ui-api): remove unused guard API env variable --- striker-ui-api/src/app.ts | 4 +--- striker-ui-api/src/lib/consts/ENV.ts | 7 ------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/striker-ui-api/src/app.ts b/striker-ui-api/src/app.ts index 51e76a39..7a46c4ad 100644 --- a/striker-ui-api/src/app.ts +++ b/striker-ui-api/src/app.ts @@ -1,8 +1,6 @@ import cors from 'cors'; import express, { json } from 'express'; -import { GUARD_API } from './lib/consts'; - import { guardApi, passport, session } from './middlewares'; import routes from './routes'; import { rrouters } from './lib/rrouters'; @@ -27,7 +25,7 @@ export default (async () => { app.use(passport.authenticate('session')); rrouters(app, routes.private, { - assign: GUARD_API ? (router) => [guardApi, router] : undefined, + assign: (router) => [guardApi, router], route: '/api', }); rrouters(app, routes.public, { route: '/api' }); diff --git a/striker-ui-api/src/lib/consts/ENV.ts b/striker-ui-api/src/lib/consts/ENV.ts index 1a56c1f8..2bf7036f 100644 --- a/striker-ui-api/src/lib/consts/ENV.ts +++ b/striker-ui-api/src/lib/consts/ENV.ts @@ -11,13 +11,6 @@ export const DEFAULT_JOB_PROGRESS: number = Number.parseInt( process.env.DEFAULT_JOB_PROGRESS ?? '0', ); -/** - * Toggles whether to guard API endpoints with session information. - */ -export const GUARD_API = process.env.GUARD_API - ? process.env.GUARD_API === 'true' - : true; - /** * Port to use by the express app. *