Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kmh11 committed Feb 19, 2019
1 parent acd4452 commit 2305c20
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ctf.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ module.exports = class CTF {

async competitionStarted (req, res, next) {
passport.authenticate('jwt', { session: false }, async function (err, user) {
if (err) return res.sendStatus(500)
if (req.competition) {
var competition = await Competition.findOne({ id: req.competition })
if (+new Date(competition.start) > +new Date() && (!user || user.admin !== true)) res.status(403).json({message: 'competition_not_started'})
Expand Down

0 comments on commit 2305c20

Please sign in to comment.