Use ensureAuthenticated as middleware

This commit is contained in:
Asher
2020-11-03 16:45:03 -06:00
parent 476379a77e
commit 34225e2bdf
5 changed files with 40 additions and 34 deletions

View File

@ -7,12 +7,7 @@ export const router = Router()
const provider = new UpdateProvider()
router.use((req, _, next) => {
ensureAuthenticated(req)
next()
})
router.get("/", async (req, res) => {
router.get("/", ensureAuthenticated, async (req, res) => {
const update = await provider.getUpdate(req.query.force === "true")
res.json({
checked: update.checked,