File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 5757 'auto_discovery ' => true ,
5858 ],
5959
60+ /*
61+ * ------------------------------------------------------------------------
62+ * Firebase Auth Component
63+ * ------------------------------------------------------------------------
64+ */
65+
66+ 'auth ' => [
67+ 'tenant_id ' => env ('FIREBASE_AUTH_TENANT_ID ' ),
68+ ],
69+
6070 /*
6171 * ------------------------------------------------------------------------
6272 * Firebase Realtime Database
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ protected function configure(string $name): FirebaseProject
6161
6262 $ config = $ this ->configuration ($ name );
6363
64+ if ($ tenantId = $ config ['auth ' ]['tenant_id ' ] ?? null ) {
65+ $ factory = $ factory ->withTenantId ($ tenantId );
66+ }
67+
6468 if ($ credentials = $ config ['credentials ' ]['file ' ] ?? null ) {
6569 $ resolvedCredentials = $ this ->resolveCredentials ((string ) $ credentials );
6670
Original file line number Diff line number Diff line change @@ -92,6 +92,23 @@ public function credentials_can_be_configured(): void
9292 $ this ->assertSame ($ credentials , $ serviceAccount ->asArray ());
9393 }
9494
95+ /**
96+ * @test
97+ */
98+ public function a_tenant_id_can_be_set (): void
99+ {
100+ $ this ->app ->config ->set ('firebase.projects.app.auth.tenant_id ' , $ expected = 'abc123 ' );
101+
102+ $ auth = $ this ->app ->make (Firebase \Auth::class);
103+
104+ /** @var Firebase\Auth\TenantId|null $tenantId */
105+ $ tenantId = ReflectionObject::createFromInstance ($ auth )->getProperty ('tenantId ' )->getValue ($ auth );
106+
107+ $ this ->assertInstanceOf (Firebase \Auth \TenantId::class, $ tenantId );
108+
109+ $ this ->assertSame ($ expected , $ tenantId ->toString ());
110+ }
111+
95112 /**
96113 * @test
97114 */
You can’t perform that action at this time.
0 commit comments