From c6da99474eca89cb991ca4c398c008088b324eec Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 13 Sep 2023 13:55:48 +0200 Subject: rename oauth2_access_token's created_at to code_created_at Signed-off-by: Julien Veyssier --- apps/oauth2/lib/Controller/OauthApiController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/oauth2/lib/Controller/OauthApiController.php') diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php index ecf0062918b..bb0f180bff9 100644 --- a/apps/oauth2/lib/Controller/OauthApiController.php +++ b/apps/oauth2/lib/Controller/OauthApiController.php @@ -126,15 +126,15 @@ class OauthApiController extends Controller { // check authorization code expiration $now = $this->timeFactory->now()->getTimestamp(); - $tokenCreatedAt = $accessToken->getCreatedAt(); - if ($tokenCreatedAt < $now - self::AUTHORIZATION_CODE_EXPIRES_AFTER) { + $codeCreatedAt = $accessToken->getCodeCreatedAt(); + if ($codeCreatedAt < $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); - $expiredSince = $now - self::AUTHORIZATION_CODE_EXPIRES_AFTER - $tokenCreatedAt; + $expiredSince = $now - self::AUTHORIZATION_CODE_EXPIRES_AFTER - $codeCreatedAt; $response->throttle(['invalid_request' => 'authorization_code_expired', 'expired_since' => $expiredSince]); return $response; } -- cgit v1.2.3