stage 2 of oauth removal, switch to sanctum pat tokens completed, docs updated

This commit is contained in:
Codex Agent
2025-11-07 07:46:53 +01:00
parent 776da57ca9
commit 67affd3317
41 changed files with 124 additions and 2148 deletions

View File

@@ -120,7 +120,7 @@ class LoginTest extends TestCase
'email_verified_at' => now(),
]);
$intended = 'http://localhost/api/v1/oauth/authorize?client_id=tenant-admin-app&response_type=code';
$intended = 'http://localhost/event-admin/dashboard?from=intended-test';
$returnTarget = '/event-admin/dashboard';
$encodedReturn = rtrim(strtr(base64_encode($returnTarget), '+/', '-_'), '=');

View File

@@ -56,7 +56,7 @@ class TenantAdminGoogleControllerTest extends TestCase
Socialite::shouldReceive('driver')->once()->with('google')->andReturn($driver);
$driver->shouldReceive('user')->once()->andReturn($socialiteUser);
$targetUrl = 'http://localhost:8000/api/v1/oauth/authorize?foo=bar';
$targetUrl = 'http://localhost:8000/event-admin/dashboard?foo=bar';
$encodedReturn = rtrim(strtr(base64_encode($targetUrl), '+/', '-_'), '=');
$this->withSession([

View File

@@ -27,6 +27,8 @@ class TenantProfileApiTest extends TestCase
'password' => Hash::make('secret-password'),
'email' => 'tenant@example.com',
'name' => 'Max Mustermann',
'first_name' => 'Max',
'last_name' => 'Mustermann',
]);
$login = $this->postJson('/api/v1/tenant-auth/login', [
@@ -57,6 +59,34 @@ class TenantProfileApiTest extends TestCase
$data = $me->json();
$this->assertEquals('Max Mustermann', data_get($data, 'user.name'));
$this->assertContains('tenant-admin', $data['abilities']);
$legacy = $this
->withHeader('Authorization', 'Bearer '.$token)
->getJson('/api/v1/tenant/me');
$legacy->assertOk();
$legacy->assertJsonFragment([
'id' => $tenant->id,
'tenant_id' => $tenant->id,
'name' => 'Test Tenant GmbH',
'event_credits_balance' => 12,
'fullName' => 'Max Mustermann',
]);
$legacy->assertJsonStructure([
'id',
'tenant_id',
'name',
'slug',
'email',
'fullName',
'event_credits_balance',
'active_reseller_package_id',
'remaining_events',
'package_expires_at',
'features',
'scopes',
]);
$this->assertContains('tenant-admin', $legacy->json('scopes'));
}
public function test_me_requires_valid_token(): void