Fix auth translations and admin PWA UI
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Tests\Feature\Auth;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Tests\TestCase;
|
||||
|
||||
class LoginTest extends TestCase
|
||||
@@ -221,6 +222,30 @@ class LoginTest extends TestCase
|
||||
$response->assertRedirect(route('verification.notice', absolute: false));
|
||||
}
|
||||
|
||||
public function test_login_redirects_unverified_user_to_verification_link_when_intended(): void
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
'email' => 'verify@example.com',
|
||||
'password' => bcrypt('password'),
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
|
||||
$verificationUrl = URL::temporarySignedRoute(
|
||||
'verification.verify',
|
||||
now()->addMinutes(60),
|
||||
['id' => $user->id, 'hash' => sha1($user->email)],
|
||||
absolute: false,
|
||||
);
|
||||
|
||||
$response = $this->withSession(['url.intended' => $verificationUrl])->post(route('login.store'), [
|
||||
'login' => 'verify@example.com',
|
||||
'password' => 'password',
|
||||
]);
|
||||
|
||||
$this->assertAuthenticated();
|
||||
$response->assertRedirect($verificationUrl);
|
||||
}
|
||||
|
||||
public function test_rate_limiting_on_failed_logins()
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
|
||||
Reference in New Issue
Block a user