mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
added log
This commit is contained in:
parent
06924cc5d4
commit
d2cdcce047
1 changed files with 8 additions and 0 deletions
|
|
@ -114,6 +114,14 @@ class ResultController {
|
|||
result.timestamp = Math.round(result.timestamp / 1000) * 1000;
|
||||
|
||||
if (result.timestamp > Math.round(Date.now() / 1000) * 1000) {
|
||||
Logger.log(
|
||||
"time_traveler",
|
||||
{
|
||||
resultTimestamp: result.timestamp,
|
||||
serverTimestamp: Math.round(Date.now() / 1000) * 1000,
|
||||
},
|
||||
uid
|
||||
);
|
||||
return res.status(400).json({ message: "Time traveler detected" });
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue