expand Justice

This commit is contained in:
KGrzeg 2021-10-18 02:33:29 +02:00
parent a16f5bb56e
commit e244da0942
8 changed files with 69 additions and 13 deletions

View file

@ -95,6 +95,14 @@ app.get("/top", (req, res) => {
})
})
app.get("/start", protect, async (req, res) => {
await db.setLastPlayedToNow(req.user.name)
res.json({
status: "ok"
})
})
app.use(function (err, req, res, next) {
if (err.name === 'UnauthorizedError') {
res.status(401).send('invalid token...');