Skip to content

Commit 1d9c121

Browse files
include interval on errors when visible
1 parent b53b0b7 commit 1d9c121

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Grant/DeviceCodeGrant.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,14 @@ public function respondToAccessTokenRequest(
158158
$this->deviceCodeRepository->persistDeviceCode($deviceCodeEntity);
159159

160160
if ($shouldSlowDown) {
161-
throw OAuthServerException::slowDown($deviceCodeEntity->getInterval());
161+
throw OAuthServerException::slowDown(
162+
$this->intervalVisibility ? $deviceCodeEntity->getInterval() : null
163+
);
162164
}
163165

164-
throw OAuthServerException::authorizationPending($deviceCodeEntity->getInterval());
166+
throw OAuthServerException::authorizationPending(
167+
$this->intervalVisibility ? $deviceCodeEntity->getInterval() : null
168+
);
165169
}
166170

167171
if ($deviceCodeEntity->getUserApproved() === false) {

0 commit comments

Comments
 (0)