From e4ef9440f46b32aef68c0b8033ef72dc25c80baa Mon Sep 17 00:00:00 2001 From: Timothy-Gonzalez <105177619+Timothy-Gonzalez@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:45:17 -0500 Subject: [PATCH] Remove unused redirects --- src/services/user/user-router.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/services/user/user-router.ts b/src/services/user/user-router.ts index acf7a921..f36443a1 100644 --- a/src/services/user/user-router.ts +++ b/src/services/user/user-router.ts @@ -6,7 +6,6 @@ import { strongJwtVerification } from "../../middleware/verify-jwt.js"; import { JwtPayload } from "../auth/auth-models.js"; import { generateJwtToken, getJwtPayloadFromDB, hasElevatedPerms, hasStaffPerms } from "../auth/auth-lib.js"; -import { UserFormat, isValidUserFormat } from "./user-formats.js"; import { UserInfo } from "../../database/user-db.js"; import Models from "../../database/models.js"; @@ -63,11 +62,6 @@ userRouter.get("/qr/", strongJwtVerification, (_: Request, res: Response) => { userRouter.get("/qr/:USERID", strongJwtVerification, async (req: Request, res: Response) => { const targetUser: string | undefined = req.params.USERID as string; - // If target user -> redirect to base function - if (!targetUser) { - return res.redirect("/user/qr/"); - } - const payload: JwtPayload = res.locals.payload as JwtPayload; let newPayload: JwtPayload | undefined; @@ -113,11 +107,6 @@ userRouter.get("/qr/:USERID", strongJwtVerification, async (req: Request, res: R * @apiUse strongVerifyErrors */ userRouter.get("/:USERID", strongJwtVerification, async (req: Request, res: Response) => { - // If no target user, exact same as next route - if (!req.params.USERID) { - return res.redirect("/"); - } - const targetUser: string = req.params.USERID ?? ""; // Get payload, and check if authorized