From c496df98e4029d82a30faf2a6c36b8df91f68db1 Mon Sep 17 00:00:00 2001 From: ApolloPY Date: Fri, 21 Aug 2015 17:17:51 +0800 Subject: [PATCH 1/2] Too idealistic. Should allow the client and server have some time difference. --- src/TokenType/MAC.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TokenType/MAC.php b/src/TokenType/MAC.php index 1eb3b930..ceac9657 100644 --- a/src/TokenType/MAC.php +++ b/src/TokenType/MAC.php @@ -84,7 +84,7 @@ class MAC extends AbstractTokenType implements TokenTypeInterface return; } - if ((int) $params->get('ts') !== time()) { + if (abs($params->get('ts') - time()) > 3600) { return; } From ace42e89e0f020bc7febe2909dd3e7cb1998d4ef Mon Sep 17 00:00:00 2001 From: apollopy Date: Fri, 21 Aug 2015 20:02:42 +0800 Subject: [PATCH 2/2] change to 300 seconds --- src/TokenType/MAC.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TokenType/MAC.php b/src/TokenType/MAC.php index ceac9657..29f5a81f 100644 --- a/src/TokenType/MAC.php +++ b/src/TokenType/MAC.php @@ -84,7 +84,7 @@ class MAC extends AbstractTokenType implements TokenTypeInterface return; } - if (abs($params->get('ts') - time()) > 3600) { + if (abs($params->get('ts') - time()) > 300) { return; }