Skip to content

Commit

Permalink
let admins look at challenges before ctf start
Browse files Browse the repository at this point in the history
  • Loading branch information
Aplet123 committed Feb 18, 2024
1 parent 3af3325 commit a743a6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/api/challs/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import config from '../../config/server'
import * as challenges from '../../challenges'
import { responses } from '../../responses'
import { getChallengeInfo } from '../../cache/leaderboard'
import perms from '../../util/perms'

export default {
method: 'GET',
path: '/challs',
requireAuth: true,
handler: async () => {
if (Date.now() < config.startTime) {
handler: async ({ user }) => {
if (Date.now() < config.startTime && !(user.perms & perms.challsRead)) {
return responses.badNotStarted
}

Expand Down

0 comments on commit a743a6a

Please sign in to comment.