diff --git a/.changeset/small-chairs-explain.md b/.changeset/small-chairs-explain.md new file mode 100644 index 00000000000..88f41ce72a6 --- /dev/null +++ b/.changeset/small-chairs-explain.md @@ -0,0 +1,5 @@ +--- +'@firebase/auth': patch +--- + +Allow port numbers in authDomain diff --git a/packages/auth/src/core/auth/initialize.test.ts b/packages/auth/src/core/auth/initialize.test.ts index efdec7f1ef1..5ca5fa6eb52 100644 --- a/packages/auth/src/core/auth/initialize.test.ts +++ b/packages/auth/src/core/auth/initialize.test.ts @@ -140,7 +140,7 @@ describe('core/auth/initialize', () => { fakeApp = initializeApp({ apiKey: 'fake-key', appId: 'fake-app-id', - authDomain: 'fake-auth-domain' + authDomain: 'fake-auth-domain:9999' }); }); @@ -165,7 +165,7 @@ describe('core/auth/initialize', () => { apiHost: 'identitytoolkit.googleapis.com', apiKey: 'fake-key', apiScheme: 'https', - authDomain: 'fake-auth-domain', + authDomain: 'fake-auth-domain:9999', clientPlatform: expectedClientPlatform, sdkClientVersion: expectedSdkClientVersion, tokenApiHost: 'securetoken.googleapis.com' diff --git a/packages/auth/src/core/auth/register.ts b/packages/auth/src/core/auth/register.ts index 1d779421c89..c203d682d00 100644 --- a/packages/auth/src/core/auth/register.ts +++ b/packages/auth/src/core/auth/register.ts @@ -72,10 +72,7 @@ export function registerAuth(clientPlatform: ClientPlatform): void { AuthErrorCode.INVALID_API_KEY, { appName: app.name } ); - // Auth domain is optional if IdP sign in isn't being used - _assert(!authDomain?.includes(':'), AuthErrorCode.ARGUMENT_ERROR, { - appName: app.name - }); + const config: ConfigInternal = { apiKey, authDomain,