From 76119811ff61d470d1752687b46d633bf838de54 Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Sun, 1 Oct 2023 16:32:04 -0700 Subject: [PATCH] bearer-auth: customcss cleanup --- src/server/routes/authRoutes.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/server/routes/authRoutes.ts b/src/server/routes/authRoutes.ts index 12e7cf7..72b5863 100644 --- a/src/server/routes/authRoutes.ts +++ b/src/server/routes/authRoutes.ts @@ -454,19 +454,7 @@ authRoutes.get("/me", requiresAccount, (req,res) => { }) authRoutes.get("/customCSS", (req,res) => { - if (!auth.validate(req.cookies.auth)) { - ServeError(res, 401, "not logged in") - return - } - - // lazy rn so - - let acc = Accounts.getFromToken(req.cookies.auth) - if (acc) { - if (acc.customCSS) { - res.redirect(`/file/${acc.customCSS}`) - } else { - res.send("") - } - } else res.send("") + let acc = res.locals.acc + if (acc?.customCSS) res.redirect(`/file/${acc.customCSS}`) + else res.send("") })