Add admin-managed user creation
linter / quality (pull_request) Successful in 1m14s
tests / ci (8.4) (pull_request) Successful in 1m37s

This commit is contained in:
2026-05-22 12:55:44 +00:00
parent 2bb74c20e1
commit d13e919310
17 changed files with 442 additions and 8 deletions
+18
View File
@@ -5,6 +5,7 @@ namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\RateLimiter;
use Inertia\Testing\AssertableInertia as Assert;
use Laravel\Fortify\Features;
use Tests\TestCase;
@@ -32,6 +33,23 @@ class AuthenticationTest extends TestCase
$response->assertRedirect(route('dashboard', absolute: false));
}
public function test_users_who_must_change_their_password_are_redirected_to_security_settings_after_login()
{
$user = User::factory()->create([
'must_change_password_on_next_login' => true,
]);
$response = $this->followingRedirects()->post(route('login.store'), [
'email' => $user->email,
'password' => 'password',
]);
$this->assertAuthenticated();
$response->assertInertia(fn (Assert $page) => $page
->component('auth/ConfirmPassword'),
);
}
public function test_users_with_two_factor_enabled_are_redirected_to_two_factor_challenge()
{
$this->skipUnlessFortifyFeature(Features::twoFactorAuthentication());