Skip to content

Commit

Permalink
RFC6750 compatibility (bshaffer#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-grzelka authored and bshaffer committed Dec 22, 2016
1 parent 94caf2e commit dfef78a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/OAuth2/Controller/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getAccessTokenData(RequestInterface $request, ResponseInterface
} elseif (!isset($token["expires"]) || !isset($token["client_id"])) {
$response->setError(401, 'malformed_token', 'Malformed token (missing "expires")');
} elseif (time() > $token["expires"]) {
$response->setError(401, 'expired_token', 'The access token provided has expired');
$response->setError(401, 'invalid_token', 'The access token provided has expired');
} else {
return $token;
}
Expand Down
2 changes: 1 addition & 1 deletion test/OAuth2/Controller/ResourceControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testExpiredToken()
$this->assertFalse($allow);

$this->assertEquals($response->getStatusCode(), 401);
$this->assertEquals($response->getParameter('error'), 'expired_token');
$this->assertEquals($response->getParameter('error'), 'invalid_token');
$this->assertEquals($response->getParameter('error_description'), 'The access token provided has expired');
}

Expand Down

0 comments on commit dfef78a

Please sign in to comment.