mirror of
https://github.com/elyby/oauth2-server.git
synced 2026-07-18 12:14:31 +05:30
Added isExpired method
This commit is contained in:
@@ -76,4 +76,10 @@ interface TokenInterface
|
||||
* @return ScopeEntityInterface[]
|
||||
*/
|
||||
public function getScopes();
|
||||
|
||||
/**
|
||||
* Has the token expired?
|
||||
* @return bool
|
||||
*/
|
||||
public function isExpired();
|
||||
}
|
||||
|
||||
@@ -123,4 +123,13 @@ trait TokenEntityTrait
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Has the token expired?
|
||||
* @return bool
|
||||
*/
|
||||
public function isExpired()
|
||||
{
|
||||
return (new \DateTime()) > $this->getExpiryDateTime();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user