Skip to content

Commit

Permalink
revert interval on authorization_pending error
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezdivandari committed Nov 14, 2024
1 parent 05821f9 commit bb92dfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
13 changes: 2 additions & 11 deletions src/Exception/OAuthServerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ public static function expiredToken(?string $hint = null, ?Throwable $previous =
return new static($errorMessage, 11, 'expired_token', 400, $hint, null, $previous);
}

public static function authorizationPending(string $hint = '', ?Throwable $previous = null, ?int $interval = null): static
public static function authorizationPending(string $hint = '', ?Throwable $previous = null): static
{
$exception = new static(
return new static(
'The authorization request is still pending as the end user ' .
'hasn\'t yet completed the user interaction steps. The client ' .
'SHOULD repeat the Access Token Request to the token endpoint',
Expand All @@ -228,15 +228,6 @@ public static function authorizationPending(string $hint = '', ?Throwable $previ
null,
$previous
);

if (!is_null($interval)) {
$exception->setPayload([
...$exception->getPayload(),
'interval' => $interval,
]);
}

return $exception;
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/Grant/DeviceCodeGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ public function respondToAccessTokenRequest(
);
}

throw OAuthServerException::authorizationPending(
interval: $this->intervalVisibility ? $deviceCodeEntity->getInterval() : null
);
throw OAuthServerException::authorizationPending();
}

if ($deviceCodeEntity->getUserApproved() === false) {
Expand Down

0 comments on commit bb92dfc

Please sign in to comment.