From 863743780820eabdc066e8b4e3c98fadb059c23a Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Wed, 20 May 2026 22:10:10 +0200 Subject: [PATCH] rephrase logged out user invite accept message to clarify that the invite was accepted --- app/Http/Controllers/Web/OrganizationInvitationController.php | 4 ++-- e2e/invitation-accept.spec.ts | 4 +++- .../Unit/Endpoint/Web/OrganizationInvitationEndpointTest.php | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Web/OrganizationInvitationController.php b/app/Http/Controllers/Web/OrganizationInvitationController.php index d0fd3606..8d6e6581 100644 --- a/app/Http/Controllers/Web/OrganizationInvitationController.php +++ b/app/Http/Controllers/Web/OrganizationInvitationController.php @@ -51,10 +51,10 @@ class OrganizationInvitationController extends Controller // Logged out — banner on /login. if (! Auth::check()) { return redirect(route('login')) - ->with('bannerText', __('Please log in to finish joining the :organization organization.', [ + ->with('bannerText', __('Great! You have accepted the invitation to join the :organization organization. Please log in to access it.', [ 'organization' => $organization->name, ])) - ->with('bannerStyle', 'info'); + ->with('bannerStyle', 'success'); } // Logged in — banner on /dashboard. diff --git a/e2e/invitation-accept.spec.ts b/e2e/invitation-accept.spec.ts index 55527de5..d5c59294 100644 --- a/e2e/invitation-accept.spec.ts +++ b/e2e/invitation-accept.spec.ts @@ -83,7 +83,9 @@ test.describe('invitation accept banners', () => { const banner = inviteePage.getByTestId('banner'); await expect(banner).toBeVisible(); - await expect(banner).toContainText(/Please log in to finish joining the .* organization\./); + await expect(banner).toContainText( + /Great! You have accepted the invitation to join the .* organization\. Please log in to access it\./ + ); // Logging in lands the invitee on the dashboard — they were already added silently // by the accept controller, so the inviter's members list shows them. diff --git a/tests/Unit/Endpoint/Web/OrganizationInvitationEndpointTest.php b/tests/Unit/Endpoint/Web/OrganizationInvitationEndpointTest.php index 7faeba64..c67bd55b 100644 --- a/tests/Unit/Endpoint/Web/OrganizationInvitationEndpointTest.php +++ b/tests/Unit/Endpoint/Web/OrganizationInvitationEndpointTest.php @@ -131,8 +131,8 @@ class OrganizationInvitationEndpointTest extends EndpointTestAbstract // Assert $response->assertValid(); $response->assertRedirect(route('login')); - $response->assertSessionHas('bannerText', 'Please log in to finish joining the '.$user->organization->name.' organization.'); - $response->assertSessionHas('bannerStyle', 'info'); + $response->assertSessionHas('bannerText', 'Great! You have accepted the invitation to join the '.$user->organization->name.' organization. Please log in to access it.'); + $response->assertSessionHas('bannerStyle', 'success'); // Member was added silently — invitation is consumed. $this->assertDatabaseHas(Member::class, [ 'user_id' => $invitee->getKey(),