mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 05:29:52 +05:30
Implemented final storage methods
This commit is contained in:
parent
71ac21b70e
commit
8be92d413d
@ -90,6 +90,8 @@ class AccessTokenStorage extends Adapter implements AccessTokenInterface
|
|||||||
*/
|
*/
|
||||||
public function delete(AbstractTokenEntity $token)
|
public function delete(AbstractTokenEntity $token)
|
||||||
{
|
{
|
||||||
die(var_dump(__METHOD__, func_get_args()));
|
Capsule::table('oauth_access_token_scopes')
|
||||||
|
->where('access_token', $token->getId())
|
||||||
|
->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,21 @@ class RefreshTokenStorage extends Adapter implements RefreshTokenInterface
|
|||||||
*/
|
*/
|
||||||
public function get($token)
|
public function get($token)
|
||||||
{
|
{
|
||||||
die(var_dump(__METHOD__, func_get_args()));
|
$result = Capsule::table('oauth_refresh_tokens')
|
||||||
|
->where('refresh_token', $token)
|
||||||
|
->where('expire_time', '>=', time())
|
||||||
|
->get();
|
||||||
|
|
||||||
|
if (count($result) === 1) {
|
||||||
|
$token = (new RefreshTokenEntity($this->server))
|
||||||
|
->setId($result[0]['refresh_token'])
|
||||||
|
->setExpireTime($result[0]['expire_time'])
|
||||||
|
->setAccessTokenId($result[0]['access_token']);
|
||||||
|
|
||||||
|
return $token;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,7 +50,9 @@ class RefreshTokenStorage extends Adapter implements RefreshTokenInterface
|
|||||||
*/
|
*/
|
||||||
public function delete(RefreshTokenEntity $token)
|
public function delete(RefreshTokenEntity $token)
|
||||||
{
|
{
|
||||||
die(var_dump(__METHOD__, func_get_args()));
|
Capsule::table('oauth_refresh_tokens')
|
||||||
|
->where('refresh_token', $token->getId())
|
||||||
|
->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user