Skip to content

Commit 7bde67b

Browse files
committed
Applying yarn run format
1 parent 85db509 commit 7bde67b

File tree

3 files changed

+37
-17
lines changed

3 files changed

+37
-17
lines changed

docs-devsite/auth.auth.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface Auth
3131
| [languageCode](./auth.auth.md#authlanguagecode) | string \| null | The [Auth](./auth.auth.md#auth_interface) instance's language code. |
3232
| [name](./auth.auth.md#authname) | string | The name of the app associated with the <code>Auth</code> service instance. |
3333
| [settings](./auth.auth.md#authsettings) | [AuthSettings](./auth.authsettings.md#authsettings_interface) | The [Auth](./auth.auth.md#auth_interface) instance's settings. |
34+
| [tenantConfig](./auth.auth.md#authtenantconfig) | [TenantConfig](./auth.tenantconfig.md#tenantconfig_interface) | The [TenantConfig](./auth.tenantconfig.md#tenantconfig_interface) used to initialize a Regional Auth. This is only present if regional auth is initialized and backend endpoint is used. |
3435
| [tenantId](./auth.auth.md#authtenantid) | string \| null | The [Auth](./auth.auth.md#auth_interface) instance's tenant ID. |
3536

3637
## Methods
@@ -120,6 +121,16 @@ This is used to edit/read configuration related options such as app verification
120121
readonly settings: AuthSettings;
121122
```
122123

124+
## Auth.tenantConfig
125+
126+
The [TenantConfig](./auth.tenantconfig.md#tenantconfig_interface) used to initialize a Regional Auth. This is only present if regional auth is initialized and backend endpoint is used.
127+
128+
<b>Signature:</b>
129+
130+
```typescript
131+
readonly tenantConfig?: TenantConfig;
132+
```
133+
123134
## Auth.tenantId
124135

125136
The [Auth](./auth.auth.md#auth_interface) instance's tenant ID.

packages/auth/src/api/index.test.ts

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ import { FirebaseError, getUA } from '@firebase/util';
2525
import * as utils from '@firebase/util';
2626

2727
import { mockEndpoint } from '../../test/helpers/api/helper';
28-
import { regionalTestAuth, testAuth, TestAuth } from '../../test/helpers/mock_auth';
28+
import {
29+
regionalTestAuth,
30+
testAuth,
31+
TestAuth
32+
} from '../../test/helpers/mock_auth';
2933
import * as mockFetch from '../../test/helpers/mock_fetch';
3034
import { AuthErrorCode } from '../core/errors';
3135
import { ConfigInternal } from '../model/auth';
@@ -599,26 +603,31 @@ describe('api/_performApiRequest', () => {
599603
});
600604
});
601605

602-
603606
it('should throw exception when tenantConfig is not initialized and Regional Endpoint is used', async () => {
604607
await expect(
605-
_performApiRequest<
606-
typeof request,
607-
typeof serverResponse
608-
>(auth, HttpMethod.POST, RegionalEndpoint.EXCHANGE_TOKEN, request)).to.be.rejectedWith(
609-
FirebaseError,
610-
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
611-
);
608+
_performApiRequest<typeof request, typeof serverResponse>(
609+
auth,
610+
HttpMethod.POST,
611+
RegionalEndpoint.EXCHANGE_TOKEN,
612+
request
613+
)
614+
).to.be.rejectedWith(
615+
FirebaseError,
616+
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
617+
);
612618
});
613619

614620
it('should throw exception when tenantConfig is initialized and default Endpoint is used', async () => {
615621
await expect(
616-
_performApiRequest<
617-
typeof request,
618-
typeof serverResponse
619-
>(regionalAuth, HttpMethod.POST, Endpoint.SIGN_UP, request)).to.be.rejectedWith(
620-
FirebaseError,
621-
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
622-
);
622+
_performApiRequest<typeof request, typeof serverResponse>(
623+
regionalAuth,
624+
HttpMethod.POST,
625+
Endpoint.SIGN_UP,
626+
request
627+
)
628+
).to.be.rejectedWith(
629+
FirebaseError,
630+
'Firebase: Operations not allowed for the auth object initialized. (auth/operation-not-allowed).'
631+
);
623632
});
624633
});

packages/auth/test/helpers/mock_auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export async function testAuth(
117117
}
118118

119119
export async function regionalTestAuth(): Promise<TestAuth> {
120-
const tenantConfig = {'location': "us", 'tenantId': "tenant-1"};
120+
const tenantConfig = { 'location': 'us', 'tenantId': 'tenant-1' };
121121
const auth: TestAuth = new AuthImpl(
122122
FAKE_APP,
123123
FAKE_HEARTBEAT_CONTROLLER_PROVIDER,

0 commit comments

Comments
 (0)