Added isExpired method to refresh token

This commit is contained in:
Alex Bilbie 2016-02-12 17:53:42 +00:00
parent 08ad67e401
commit e20c529f39
2 changed files with 15 additions and 0 deletions

View File

@ -39,4 +39,10 @@ interface RefreshTokenEntityInterface
* @return \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
*/
public function getAccessToken();
/**
* Has the token expired?
* @return bool
*/
public function isExpired();
}

View File

@ -50,4 +50,13 @@ trait RefreshTokenTrait
{
$this->expiryDateTime = $dateTime;
}
/**
* Has the token expired?
* @return bool
*/
public function isExpired()
{
return (new DateTime()) > $this->getExpiryDateTime();
}
}