Skip to content

Commit

Permalink
Day18
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesChou committed Oct 3, 2022
1 parent fa3a040 commit 7132be3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/Console/Commands/OAuth2TokenRevoke.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Ory\Hydra\Client\Api\AdminApi;
use Ory\Hydra\Client\Api\PublicApi;

/**
* Revoke Token
*/
class OAuth2TokenRevoke extends Command
{
protected $signature = 'oauth2:token:revoke {token}';

protected $description = 'Revoke OAuth 2.0 Token by Public API';

public function handle(PublicApi $public): int
{
$token = $this->argument('token');

$public->revokeOAuth2Token($token);

$this->line('Revoke done.');

return 0;
}
}

0 comments on commit 7132be3

Please sign in to comment.