bearer-auth: customcss cleanup

This commit is contained in:
May 2023-10-01 16:32:04 -07:00
parent c8e486630e
commit 76119811ff

View file

@ -454,19 +454,7 @@ authRoutes.get("/me", requiresAccount, (req,res) => {
}) })
authRoutes.get("/customCSS", (req,res) => { authRoutes.get("/customCSS", (req,res) => {
if (!auth.validate(req.cookies.auth)) { let acc = res.locals.acc
ServeError(res, 401, "not logged in") if (acc?.customCSS) res.redirect(`/file/${acc.customCSS}`)
return else res.send("")
}
// 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("")
}) })