fix(client event handler): future lenience

This commit is contained in:
DecDuck
2024-12-24 17:46:56 +11:00
parent cada630e81
commit 5c78b20504

View File

@ -35,8 +35,8 @@ export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
const nonceTime = parseInt(nonce);
const current = Date.now();
if (
// If it was generated in the future
nonceTime > current ||
// If it "will be generated" in thirty seconds
nonceTime > current + NONCE_LENIENCE ||
// Or more than thirty seconds ago
nonceTime < current - NONCE_LENIENCE
) {