Skip to content

Commit

Permalink
Less strict HTTP code check
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Aug 1, 2015
1 parent dd80f49 commit bfe4197
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Server/AuthorizationServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ public function handleAuthorizationRequest(ServerRequestInterface $request, Toke
$event = new AuthorizationCodeEvent($request, $response, $owner);
$event->setTarget($this);

if ($response->getStatusCode() === 200) {
$statusCode = $response->getStatusCode();

if ($statusCode >= 200 && $statusCode <= 399) {
$this->getEventManager()->trigger(AuthorizationCodeEvent::EVENT_CODE_CREATED, $event);
} else {
$this->getEventManager()->trigger(AuthorizationCodeEvent::EVENT_CODE_FAILED, $event);
Expand Down Expand Up @@ -237,7 +239,9 @@ public function handleTokenRequest(ServerRequestInterface $request, TokenOwnerIn
$event = new TokenEvent($request, $response, $owner);
$event->setTarget($this);

if ($response->getStatusCode() === 200) {
$statusCode = $response->getStatusCode();

if ($statusCode >= 200 && $statusCode <= 399) {
$this->getEventManager()->trigger(TokenEvent::EVENT_TOKEN_CREATED, $event);
} else {
$this->getEventManager()->trigger(TokenEvent::EVENT_TOKEN_FAILED, $event);
Expand Down

0 comments on commit bfe4197

Please sign in to comment.