Signiere Bestätigung und Ausgaben über den Pfad, damit der Port die Links nicht ungültig macht.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2113378e81
commit
63f2be565f
8 files changed
+69
-10
No files matched your search
@@ -13,13 +13,13 @@
|
||||
use App\Domain\Entitlement\Grant;
|
||||
use App\Domain\Entitlement\GrantIssuer;
|
||||
use App\Domain\Entitlement\GrantStatus;
|
||||
use App\Http\SignedLink;
|
||||
use App\Mail\OrderConfirmed;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\DemoCatalogSeeder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Tests\TestCase;
|
||||
|
||||
class MembershipAccessTest extends TestCase
|
||||
@@ -103,7 +103,7 @@ public function test_a_member_can_read_an_entitled_text_and_a_stranger_cannot():
|
||||
$version = $release->contents->first()->elementVersion;
|
||||
|
||||
$this->actingAs($member)->get(route('member.article', $article))->assertOk()->assertSee($article->code);
|
||||
$url = URL::temporarySignedRoute('member.media', now()->addMinutes(5), [
|
||||
$url = SignedLink::temporary('member.media', now()->addMinutes(5), [
|
||||
'article' => $article->id,
|
||||
'release' => $release->id,
|
||||
'version' => $version->id,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Notifications\VerifyEmailAddress;
|
||||
use Illuminate\Auth\Notifications\ResetPassword;
|
||||
use Illuminate\Auth\Notifications\VerifyEmail;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Tests\TestCase;
|
||||
@@ -47,7 +47,7 @@ public function test_registration_creates_a_person_and_sends_verification(): voi
|
||||
$this->assertSame('person', $user->party->type->value);
|
||||
$this->assertSame('private', $user->party->profile->visibility['display_name']);
|
||||
$this->assertAuthenticatedAs($user);
|
||||
Notification::assertSentTo($user, VerifyEmail::class);
|
||||
Notification::assertSentTo($user, VerifyEmailAddress::class);
|
||||
}
|
||||
|
||||
public function test_placeholder_app_url_uses_the_address_opened_in_the_browser(): void
|
||||
@@ -66,8 +66,14 @@ public function test_placeholder_app_url_uses_the_address_opened_in_the_browser(
|
||||
$response->assertRedirect(url('/email/bestaetigen'));
|
||||
|
||||
$user = User::query()->where('email', 'probe@example.test')->firstOrFail();
|
||||
Notification::assertSentTo($user, VerifyEmail::class, function (VerifyEmail $notification) use ($user): bool {
|
||||
Notification::assertSentTo($user, VerifyEmailAddress::class, function (VerifyEmailAddress $notification) use ($user): bool {
|
||||
$link = $notification->toMail($user)->actionUrl;
|
||||
$path = parse_url($link, PHP_URL_PATH);
|
||||
$query = parse_url($link, PHP_URL_QUERY);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get($path.'?'.$query)
|
||||
->assertRedirect(route('member.dashboard'));
|
||||
|
||||
return str_starts_with($link, url('/email/bestaetigen/'))
|
||||
&& ! str_contains($link, 'CHANGE-ME.example');
|
||||
|
||||
Reference in new issue
Block a user