Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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('returns null if currentUser is undefined', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this instead say throws error if regionalAuth is initialized? We can add a comment as well to say this is expected as there is no user in regional auth. WDYT?

expect(() => regionalAuthInternal.getUid()).to.throw(
FirebaseError,
'auth/operation-not-allowed'
);
});
});
});
5 changes: 5 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,7 @@ export class AuthInterop implements FirebaseAuthInternal {

getUid(): string | null {
this.assertAuthConfigured();
this.assertRegionalAuthConfigured();
return this.auth.currentUser?.uid || null;
}

Expand Down Expand Up @@ -90,6 +91,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