diff --git a/config-example.json b/config-example.json index 097cfdf..276cfa7 100644 --- a/config-example.json +++ b/config-example.json @@ -167,7 +167,6 @@ ], "session_secret": "233", "rabbitMQ": "amqp://localhost/", - "judge_token": "233", "email_jwt_secret": "test", "google_analytics": "UA-XXXXXXXX-X" } diff --git a/modules/contest.js b/modules/contest.js index 284c252..a905211 100644 --- a/modules/contest.js +++ b/modules/contest.js @@ -390,7 +390,7 @@ app.get('/contest/:id/submissions', async (req, res) => { taskId: x.task_id, type: pushType, displayConfig: displayConfig - }, syzoj.config.judge_token) : null, + }, syzoj.config.session_secret) : null, result: getRoughResult(x, displayConfig), running: false, })), @@ -445,7 +445,7 @@ app.get('/contest/submission/:id', async (req, res) => { taskId: judge.task_id, displayConfig: displayConfig, type: 'detail' - }, syzoj.config.judge_token) : null, + }, syzoj.config.session_secret) : null, displayConfig: displayConfig, contest: contest, }); diff --git a/modules/socketio.js b/modules/socketio.js index cd137c1..aae0d91 100644 --- a/modules/socketio.js +++ b/modules/socketio.js @@ -97,7 +97,7 @@ function initializeSocketIO(s) { winston.info(`Client ${socket.id} connected.`); let req; try { - req = jwt.verify(reqJwt, syzoj.config.judge_token); + req = jwt.verify(reqJwt, syzoj.config.session_secret); if (req.type !== name) { throw new Error("Request type in token mismatch."); } diff --git a/modules/submission.js b/modules/submission.js index 65b21ac..4502511 100644 --- a/modules/submission.js +++ b/modules/submission.js @@ -125,7 +125,7 @@ app.get('/submissions', async (req, res) => { taskId: x.task_id, type: 'rough', displayConfig: displayConfig - }, syzoj.config.judge_token) : null, + }, syzoj.config.session_secret) : null, result: getRoughResult(x, displayConfig), running: false, })), @@ -178,7 +178,7 @@ app.get('/submission/:id', async (req, res) => { taskId: judge.task_id, type: 'detail', displayConfig: displayConfig - }, syzoj.config.judge_token) : null, + }, syzoj.config.session_secret) : null, displayConfig: displayConfig, }); } catch (e) {