mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 17:56:14 +05:30
Added isExpired method
This commit is contained in:
parent
a0d5d5817b
commit
f4cfd37745
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user