mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-11 02:50:29 +00:00
4c81e20529
Adds a "API Tokens" settings page so an authenticated user can create and revoke Sanctum personal access tokens for the new authenticated write endpoints — using the official Sanctum API ($user->createToken() / tokens()). - New Volt component settings/api-tokens (create token, one-time plain-text reveal with copy-to-clipboard, list + revoke own tokens). - Registered route settings.api-tokens (country-prefixed, auth group) and added a nav entry in the settings layout. - SEO definition for the new page. - Pest feature tests (create/reveal-once, validation, revoke, ownership scoping) and a Pest browser screenshot test.
20 lines
636 B
PHP
20 lines
636 B
PHP
<?php
|
|
|
|
it('shows the api token management UI and the one-time token reveal', function () {
|
|
$user = actingAsUser(['name' => 'Lecturer Demo', 'is_lecturer' => true]);
|
|
|
|
// Pre-existing token so the "Aktive Tokens" table is populated.
|
|
$user->createToken('Mein Laptop');
|
|
|
|
$page = visit('/de/settings/api-tokens');
|
|
|
|
$page->assertSee('API Tokens')
|
|
->fill('name', 'Externer Kurs-Sync')
|
|
->click('Token erstellen')
|
|
->wait(1)
|
|
->assertSee('Dein neues API Token')
|
|
->assertSee('Aktive Tokens')
|
|
->assertNoJavaScriptErrors()
|
|
->screenshot(filename: 'settings-api-tokens');
|
|
});
|