Fix Host portal showing for users without a linked host profile.
Deploy Ladill Frontdesk / deploy (push) Successful in 28s
Deploy Ladill Frontdesk / deploy (push) Successful in 28s
Only show the sidebar link when a host record is linked to the signed-in user, and redirect direct visits to the dashboard with a clear message instead of a 403 page. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -81,6 +81,32 @@ class FrontdeskPhase6Test extends TestCase
|
||||
->assertSee('Phase6 Host');
|
||||
}
|
||||
|
||||
public function test_org_admin_without_linked_host_cannot_access_host_portal(): void
|
||||
{
|
||||
$admin = User::create([
|
||||
'public_id' => 'phase6-admin-001',
|
||||
'name' => 'Org Admin',
|
||||
'email' => 'admin@example.com',
|
||||
]);
|
||||
|
||||
Member::create([
|
||||
'owner_ref' => $this->user->public_id,
|
||||
'organization_id' => $this->organization->id,
|
||||
'user_ref' => $admin->public_id,
|
||||
'role' => 'org_admin',
|
||||
]);
|
||||
|
||||
$this->actingAs($admin)
|
||||
->get(route('frontdesk.dashboard'))
|
||||
->assertOk()
|
||||
->assertDontSee('Host portal', false);
|
||||
|
||||
$this->actingAs($admin)
|
||||
->get(route('frontdesk.host.index'))
|
||||
->assertRedirect(route('frontdesk.dashboard'))
|
||||
->assertSessionHas('error');
|
||||
}
|
||||
|
||||
public function test_host_can_pre_register_visitor(): void
|
||||
{
|
||||
$this->actingAs($this->user)
|
||||
|
||||
Reference in New Issue
Block a user