mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
delete oauth access token when receiving a code that has expired
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
1ab45bad5d
commit
779e1d51ac
1 changed files with 3 additions and 0 deletions
|
|
@ -128,6 +128,9 @@ class OauthApiController extends Controller {
|
|||
$now = $this->timeFactory->now()->getTimestamp();
|
||||
$tokenCreatedAt = $accessToken->getCreatedAt();
|
||||
if ($tokenCreatedAt < $now - self::AUTHORIZATION_CODE_EXPIRES_AFTER) {
|
||||
// we know this token is not useful anymore
|
||||
$this->accessTokenMapper->delete($accessToken);
|
||||
|
||||
$response = new JSONResponse([
|
||||
'error' => 'invalid_request',
|
||||
], Http::STATUS_BAD_REQUEST);
|
||||
|
|
|
|||
Loading…
Reference in a new issue