mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 18:04:27 +08:00
using sent timestamp to verify and then changing to server time
This commit is contained in:
parent
57b25bbfcc
commit
6dc72700da
1 changed files with 3 additions and 1 deletions
|
|
@ -106,7 +106,7 @@ class ResultController {
|
|||
// return res.status(400).json({ message: "Time traveler detected" });
|
||||
// }
|
||||
|
||||
result.timestamp = Math.round(Date.now() / 1000) * 1000;
|
||||
result.timestamp = Math.round(result.timestamp / 1000) * 1000;
|
||||
|
||||
let timestampres = await ResultDAO.getResultByTimestamp(
|
||||
uid,
|
||||
|
|
@ -116,6 +116,8 @@ class ResultController {
|
|||
return res.status(400).json({ message: "Duplicate result" });
|
||||
}
|
||||
|
||||
result.timestamp = Math.round(Date.now() / 1000) * 1000;
|
||||
|
||||
try {
|
||||
result.keySpacingStats = {
|
||||
average:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue