feat(KAN-21): rebuild login verification and two-factor flows
CI/CD / test_and_check_app (push) Failing after 1m34s
CI/CD / Publish immutable image (push) Skipped
CI/CD / test_and_check_app (pull_request) Canceled after 0s
CI/CD / Publish immutable image (pull_request) Canceled after 0s

This commit is contained in:
2026-09-10 11:02:15 +02:00
parent 7edd8daf49
commit a43aff0477
17 changed files with 1294 additions and 250 deletions
+18 -1
View File
@@ -4,6 +4,7 @@ namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Inertia\Testing\AssertableInertia as Assert;
use Laravel\Fortify\Features;
@@ -85,7 +86,7 @@ class AuthenticationTest extends TestCase
$this->post(route('login.store'), [
'email' => $user->email,
'password' => 'wrong-password',
]);
])->assertSessionHasErrors('email');
$this->assertGuest();
}
@@ -100,6 +101,22 @@ class AuthenticationTest extends TestCase
$response->assertRedirect(route('home'));
}
public function test_login_preserves_the_intended_destination_and_remember_choice(): void
{
$user = User::factory()->create();
$this->withSession(['url.intended' => route('dashboard')])
->post(route('login.store'), [
'email' => $user->email,
'password' => 'password',
'remember' => true,
])
->assertRedirect(route('dashboard'))
->assertCookie(Auth::guard('web')->getRecallerName());
$this->assertAuthenticatedAs($user);
}
public function test_users_are_rate_limited()
{
$user = User::factory()->create();