Skip to content

Commit 0356d18

Browse files
[13.x] Added device code grant exception to purge command (#1846)
* Added device code grant exception to purge command * Update PurgeCommand.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 79f96c2 commit 0356d18

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Console/PurgeCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ public function handle(): void
4646
Passport::token()->newQuery()->where($constraint)->delete();
4747
Passport::authCode()->newQuery()->where($constraint)->delete();
4848
Passport::refreshToken()->newQuery()->where($constraint)->delete();
49-
Passport::deviceCode()->newQuery()->where($constraint)->delete();
49+
50+
if (Passport::$deviceCodeGrantEnabled) {
51+
Passport::deviceCode()->newQuery()->where($constraint)->delete();
52+
}
5053

5154
$this->components->info(sprintf('Purged %s.', implode(' and ', array_filter([
5255
$revoked ? 'revoked items' : null,

0 commit comments

Comments
 (0)