From d579f39c73b8c7364af8ff748d8cdb361f012d8c Mon Sep 17 00:00:00 2001 From: mansisampat Date: Thu, 16 Oct 2025 12:55:54 +0530 Subject: [PATCH 1/4] Throw UnsupportedOperationException in FirebaseAuthInterop getUid for regionalAuth --- packages/auth/src/core/auth/firebase_internal.test.ts | 9 +++++++++ packages/auth/src/core/auth/firebase_internal.ts | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/auth/src/core/auth/firebase_internal.test.ts b/packages/auth/src/core/auth/firebase_internal.test.ts index 6932b436427..e6cf39ee9b4 100644 --- a/packages/auth/src/core/auth/firebase_internal.test.ts +++ b/packages/auth/src/core/auth/firebase_internal.test.ts @@ -326,4 +326,13 @@ describe('core/auth/firebase_internal - Regional Firebase Auth', () => { expect(await regionalAuthInternal.getToken()).to.eql(null); }); }); + + context('getUid', () => { + it('returns null if currentUser is undefined', () => { + expect(() => regionalAuthInternal.getUid()).to.throw( + FirebaseError, + 'auth/operation-not-allowed' + ); + }); + }); }); diff --git a/packages/auth/src/core/auth/firebase_internal.ts b/packages/auth/src/core/auth/firebase_internal.ts index 4396283bb5f..b86afa79199 100644 --- a/packages/auth/src/core/auth/firebase_internal.ts +++ b/packages/auth/src/core/auth/firebase_internal.ts @@ -36,6 +36,7 @@ export class AuthInterop implements FirebaseAuthInternal { getUid(): string | null { this.assertAuthConfigured(); + this.assertRegionalAuthConfigured(); return this.auth.currentUser?.uid || null; } @@ -90,6 +91,13 @@ export class AuthInterop implements FirebaseAuthInternal { ); } + + private assertRegionalAuthConfigured(): void { + _assert( + !this.auth.tenantConfig, + AuthErrorCode.OPERATION_NOT_ALLOWED); + } + private updateProactiveRefresh(): void { if (this.internalListeners.size > 0) { this.auth._startProactiveRefresh(); From bddadface7ce423dfbd9b3b4e849cda82d69111f Mon Sep 17 00:00:00 2001 From: mansisampat Date: Thu, 16 Oct 2025 13:01:14 +0530 Subject: [PATCH 2/4] yarn run format --- packages/auth/src/core/auth/firebase_internal.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/auth/src/core/auth/firebase_internal.ts b/packages/auth/src/core/auth/firebase_internal.ts index b86afa79199..7c1be6682bc 100644 --- a/packages/auth/src/core/auth/firebase_internal.ts +++ b/packages/auth/src/core/auth/firebase_internal.ts @@ -91,11 +91,8 @@ export class AuthInterop implements FirebaseAuthInternal { ); } - private assertRegionalAuthConfigured(): void { - _assert( - !this.auth.tenantConfig, - AuthErrorCode.OPERATION_NOT_ALLOWED); + _assert(!this.auth.tenantConfig, AuthErrorCode.OPERATION_NOT_ALLOWED); } private updateProactiveRefresh(): void { From f485cbff600f3193fe97aaf0943bb69366ac5f39 Mon Sep 17 00:00:00 2001 From: mansisampat Date: Fri, 17 Oct 2025 11:25:12 +0530 Subject: [PATCH 3/4] Updating the chrome_validated_version for tests --- .github/workflows/test-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 02c3ab0326f..8a354b453ac 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -23,7 +23,7 @@ env: # the behavior to use the new URLs. CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/ CHROMEDRIVER_CDNBINARIESURL: https://storage.googleapis.com/chrome-for-testing-public - CHROME_VALIDATED_VERSION: linux-132.0.6834.110 + CHROME_VALIDATED_VERSION: linux-141.0.7390.78 CHROME_VERSION_MISMATCH_MESSAGE: "The Chrome version doesn't match the previously validated version. Consider updating CHROME_VALIDATED_VERSION in the GitHub workflow if tests pass, or rollback the installed Chrome version if tests fail." artifactRetentionDays: 14 # Bump Node memory limit From 3a64510518c42be6dc39f1b686794079a8579dff Mon Sep 17 00:00:00 2001 From: mansisampat Date: Tue, 21 Oct 2025 16:17:28 +0530 Subject: [PATCH 4/4] Address comments --- packages/auth/src/core/auth/firebase_internal.test.ts | 2 +- packages/auth/src/core/auth/firebase_internal.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/auth/src/core/auth/firebase_internal.test.ts b/packages/auth/src/core/auth/firebase_internal.test.ts index e6cf39ee9b4..5954412364e 100644 --- a/packages/auth/src/core/auth/firebase_internal.test.ts +++ b/packages/auth/src/core/auth/firebase_internal.test.ts @@ -328,7 +328,7 @@ describe('core/auth/firebase_internal - Regional Firebase Auth', () => { }); context('getUid', () => { - it('returns null if currentUser is undefined', () => { + it('throws an error if regionalAuth is initialized', () => { expect(() => regionalAuthInternal.getUid()).to.throw( FirebaseError, 'auth/operation-not-allowed' diff --git a/packages/auth/src/core/auth/firebase_internal.ts b/packages/auth/src/core/auth/firebase_internal.ts index 7c1be6682bc..970e99fa4ec 100644 --- a/packages/auth/src/core/auth/firebase_internal.ts +++ b/packages/auth/src/core/auth/firebase_internal.ts @@ -36,6 +36,7 @@ export class AuthInterop implements FirebaseAuthInternal { getUid(): string | null { this.assertAuthConfigured(); + // getUid() is not available for regional Auth. Returns `OPERATION_NOT_ALLOWED` exception for RegionalAuth. this.assertRegionalAuthConfigured(); return this.auth.currentUser?.uid || null; }