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