Skip to content

Commit

Permalink
Also delete expired refresh and auth tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Apr 4, 2014
1 parent c31a65f commit 51a7e2b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ZfrOAuth2Module/Server/Controller/TokenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function tokenAction()
{
// Can't do anything if not HTTP request...
if (!$this->request instanceof HttpRequest) {
return;
return null;
}

return $this->authorizationServer->handleTokenRequest($this->request);
Expand All @@ -74,6 +74,14 @@ public function deleteExpiredTokensAction()
$accessTokenService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\AccessTokenService');
$accessTokenService->deleteExpiredTokens();

return "\nExpired access tokens were properly deleted!\n\n";
/* @var \ZfrOAuth2\Server\Service\TokenService $refreshTokenService */
$refreshTokenService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\RefreshTokenService');
$refreshTokenService->deleteExpiredTokens();

/* @var \ZfrOAuth2\Server\Service\TokenService $authorizationCodeService */
$authorizationCodeService = $this->serviceLocator->get('ZfrOAuth2\Server\Service\AuthorizationCodeService');
$authorizationCodeService->deleteExpiredTokens();

return "\nExpired tokens were properly deleted!\n\n";
}
}

0 comments on commit 51a7e2b

Please sign in to comment.