mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-10 23:56:22 +08:00
brought back time traveler check with rounded timestamps
This commit is contained in:
parent
472e8d9472
commit
06924cc5d4
1 changed files with 4 additions and 4 deletions
|
@ -111,12 +111,12 @@ class ResultController {
|
|||
return res.status(400).json({ message: "Incorrect result hash" });
|
||||
}
|
||||
|
||||
// if (result.timestamp > Date.now()) {
|
||||
// return res.status(400).json({ message: "Time traveler detected" });
|
||||
// }
|
||||
|
||||
result.timestamp = Math.round(result.timestamp / 1000) * 1000;
|
||||
|
||||
if (result.timestamp > Math.round(Date.now() / 1000) * 1000) {
|
||||
return res.status(400).json({ message: "Time traveler detected" });
|
||||
}
|
||||
|
||||
let timestampres = await ResultDAO.getResultByTimestamp(
|
||||
uid,
|
||||
result.timestamp
|
||||
|
|
Loading…
Add table
Reference in a new issue