fix: ignore tenant cookies on unauthenticated Nova pages

This commit is contained in:
MeghdadFadaee committed 2026-09-09 19:50:05 +03:30
1 parent aafddfb146
commit 9a28ff7354
3 files changed
+25

No files matched your search

+9
View File
@@ -30,6 +30,15 @@ it('resolves only an accessible tenant from the cookie', function (): void {
expect((new CurrentTenant(new UserTenantProvider, $request))->model())->toBeNull();
});
it('ignores a persisted tenant cookie for unauthenticated requests', function (): void {
$request = Request::create('/nova/login');
$request->cookies->set('nova_tenant', '1');
$context = new CurrentTenant(new UserTenantProvider, $request);
expect($context->model())->toBeNull();
});
it('provides scoped string bindings and strict accessors', function (): void {
expect(app('CurrentTenantId'))->toBeNull()
->and(app('CurrentTenantModel'))->toBeNull()