Add admin page to list and revoke Micropub tokens
Gives a way to actually use the revocation capability built up over the last few commits from the admin side, not just self-service via the client. Lists client_id/scope/issue time per token (never the raw token itself, since only its hash is stored) with a revoke button for active ones. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014625MfkGZ7GVdbqKme4a8L
This commit is contained in:
parent
9c9a6392c8
commit
9d6cf6c815
5 changed files with 159 additions and 0 deletions
33
app/Http/Controllers/Admin/TokensController.php
Normal file
33
app/Http/Controllers/Admin/TokensController.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\MicropubToken;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class TokensController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show a list of issued Micropub tokens.
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
$tokens = MicropubToken::latest()->get();
|
||||
|
||||
return view('admin.tokens.index', compact('tokens'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Revoke a Micropub token.
|
||||
*/
|
||||
public function revoke(MicropubToken $token): RedirectResponse
|
||||
{
|
||||
$token->revoke();
|
||||
|
||||
return redirect('/admin/tokens');
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue