mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-03 18:51:53 +05:30
Added isExpired method to refresh token
This commit is contained in:
parent
08ad67e401
commit
e20c529f39
@ -39,4 +39,10 @@ interface RefreshTokenEntityInterface
|
|||||||
* @return \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
|
* @return \League\OAuth2\Server\Entities\Interfaces\AccessTokenEntityInterface
|
||||||
*/
|
*/
|
||||||
public function getAccessToken();
|
public function getAccessToken();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Has the token expired?
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isExpired();
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,13 @@ trait RefreshTokenTrait
|
|||||||
{
|
{
|
||||||
$this->expiryDateTime = $dateTime;
|
$this->expiryDateTime = $dateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Has the token expired?
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isExpired()
|
||||||
|
{
|
||||||
|
return (new DateTime()) > $this->getExpiryDateTime();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user