mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-26 17:54:44 +10:00
fix(client event handler): future lenience
This commit is contained in:
@@ -35,8 +35,8 @@ export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
|
|||||||
const nonceTime = parseInt(nonce);
|
const nonceTime = parseInt(nonce);
|
||||||
const current = Date.now();
|
const current = Date.now();
|
||||||
if (
|
if (
|
||||||
// If it was generated in the future
|
// If it "will be generated" in thirty seconds
|
||||||
nonceTime > current ||
|
nonceTime > current + NONCE_LENIENCE ||
|
||||||
// Or more than thirty seconds ago
|
// Or more than thirty seconds ago
|
||||||
nonceTime < current - NONCE_LENIENCE
|
nonceTime < current - NONCE_LENIENCE
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user