No challenges are returned when event is not started.

This commit is contained in:
m0rph3us1987
2026-02-28 01:32:18 +01:00
parent 6127bfbeb2
commit d33a1c6a72
2 changed files with 5 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hipCTF26</title> <title>HIP7CTF</title>
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800&display=swap" rel="stylesheet">
<style> <style>

View File

@@ -211,7 +211,9 @@ apiRouter.get('/state', async (req, res) => {
if (err) return res.status(500).json({ error: 'Failed to fetch blogs' }); if (err) return res.status(500).json({ error: 'Failed to fetch blogs' });
state.solves = solves || []; state.solves = solves || [];
state.blogs = blogs || []; state.blogs = blogs || [];
if (!teamId || (!isAdmin && !state.isStarted)) { const startTime = parseInt(state.config.eventStartTime || "0", 10);
const isBeforeStart = Date.now() < startTime;
if (!teamId || (!isAdmin && (!state.isStarted || isBeforeStart))) {
state.challenges = []; state.challenges = [];
} else { } else {
state.challenges = (challenges || []).map(c => { state.challenges = (challenges || []).map(c => {