Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions packages/auth/src/core/auth/firebase_internal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,13 @@ describe('core/auth/firebase_internal - Regional Firebase Auth', () => {
expect(await regionalAuthInternal.getToken()).to.eql(null);
});
});

context('getUid', () => {
it('throws an error if regionalAuth is initialized', () => {
expect(() => regionalAuthInternal.getUid()).to.throw(
FirebaseError,
'auth/operation-not-allowed'
);
});
});
});
6 changes: 6 additions & 0 deletions packages/auth/src/core/auth/firebase_internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ 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;
}

Expand Down Expand Up @@ -90,6 +92,10 @@ 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();
Expand Down
Loading