{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/oauth2-server/issues/320","labels_url":"https://api.github.com/repos/thephpleague/oauth2-server/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/oauth2-server/issues/320/comments","events_url":"https://api.github.com/repos/thephpleague/oauth2-server/issues/320/events","html_url":"https://github.com/thephpleague/oauth2-server/issues/320","id":59767490,"number":320,"title":"Inverted condition in AbstractTokenEntity::isExpired()","user":{"login":"mcd-php","id":3469206,"avatar_url":"https://avatars.githubusercontent.com/u/3469206?v=3","gravatar_id":"","url":"https://api.github.com/users/mcd-php","html_url":"https://github.com/mcd-php","followers_url":"https://api.github.com/users/mcd-php/followers","following_url":"https://api.github.com/users/mcd-php/following{/other_user}","gists_url":"https://api.github.com/users/mcd-php/gists{/gist_id}","starred_url":"https://api.github.com/users/mcd-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcd-php/subscriptions","organizations_url":"https://api.github.com/users/mcd-php/orgs","repos_url":"https://api.github.com/users/mcd-php/repos","events_url":"https://api.github.com/users/mcd-php/events{/privacy}","received_events_url":"https://api.github.com/users/mcd-php/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-04T08:53:01Z","updated_at":"2015-03-17T13:40:02Z","closed_at":"2015-03-17T13:40:02Z","body":"See [AbstractTokenEntity.php#L116](https://github.com/thephpleague/oauth2-server/blob/2108c88dfba643e48334337e0f1c12d48889da0e/src/Entity/AbstractTokenEntity.php#L116):\r\n```php\r\n    public function isExpired()\r\n    {\r\n        return ((time() - $this->expireTime) > 0);\r\n    }\r\n```\r\n\r\nLet's we are in 1970, `time()` is 900, `expireTime` is 1000, token is fresh and has entire 100 seconds to expire. But the expression 900 - 1000 = -100 and is **negative**, so the token is rotten and will become fresh forever after expiry time.\r\n\r\nFlipping the comparison actually did help me to get through the error to next one."},"comment":{"url":"https://api.github.com/repos/thephpleague/oauth2-server/issues/comments/82357254","html_url":"https://github.com/thephpleague/oauth2-server/issues/320#issuecomment-82357254","issue_url":"https://api.github.com/repos/thephpleague/oauth2-server/issues/320","id":82357254,"user":{"login":"mcd-php","id":3469206,"avatar_url":"https://avatars.githubusercontent.com/u/3469206?v=3","gravatar_id":"","url":"https://api.github.com/users/mcd-php","html_url":"https://github.com/mcd-php","followers_url":"https://api.github.com/users/mcd-php/followers","following_url":"https://api.github.com/users/mcd-php/following{/other_user}","gists_url":"https://api.github.com/users/mcd-php/gists{/gist_id}","starred_url":"https://api.github.com/users/mcd-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcd-php/subscriptions","organizations_url":"https://api.github.com/users/mcd-php/orgs","repos_url":"https://api.github.com/users/mcd-php/repos","events_url":"https://api.github.com/users/mcd-php/events{/privacy}","received_events_url":"https://api.github.com/users/mcd-php/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T13:40:02Z","updated_at":"2015-03-17T13:40:02Z","body":"Yeah, sorry. Seemingly the real issue was value scaling/transform in my DB library."}}