Browse Source

Remove judge_token, which is replaced by session_secret

master
Menci 6 years ago
parent
commit
d9d496518a
  1. 1
      config-example.json
  2. 4
      modules/contest.js
  3. 2
      modules/socketio.js
  4. 4
      modules/submission.js

1
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"
}

4
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,
});

2
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.");
}

4
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) {

Loading…
Cancel
Save