Skip to content

Commit b609765

Browse files
committed
Implement exchangeToken public api
1 parent c0cc6eb commit b609765

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

packages/auth/src/api/index.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const enum HttpHeader {
5454
X_FIREBASE_APP_CHECK = 'X-Firebase-AppCheck'
5555
}
5656

57-
export enum Endpoint {
57+
export const enum Endpoint {
5858
CREATE_AUTH_URI = '/v1/accounts:createAuthUri',
5959
DELETE_ACCOUNT = '/v1/accounts:delete',
6060
RESET_PASSWORD = '/v1/accounts:resetPassword',
@@ -155,7 +155,6 @@ async function performApiRequest<T, V>(
155155
request?: T,
156156
customErrorMap: Partial<ServerErrorMap<ServerError>> = {}
157157
): Promise<V> {
158-
_assertValidEndpointForAuth(auth, path);
159158
return _performFetchWithErrorHandling(auth, customErrorMap, async () => {
160159
let body = {};
161160
let params = {};
@@ -375,22 +374,6 @@ export function _parseEnforcementState(
375374
}
376375
}
377376

378-
function _assertValidEndpointForAuth(
379-
auth: Auth,
380-
path: Endpoint | RegionalEndpoint
381-
): void {
382-
if (
383-
!auth.tenantConfig &&
384-
Object.values(RegionalEndpoint).includes(path as RegionalEndpoint)
385-
) {
386-
throw _operationNotSupportedForInitializedAuthInstance(auth);
387-
}
388-
389-
if (auth.tenantConfig && Object.values(Endpoint).includes(path as Endpoint)) {
390-
throw _operationNotSupportedForInitializedAuthInstance(auth);
391-
}
392-
}
393-
394377
class NetworkTimeout<T> {
395378
// Node timers and browser timers are fundamentally incompatible, but we
396379
// don't care about the value here

packages/auth/test/helpers/api/helper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,5 @@ export function mockRegionalEndpointWithParent(
6363
status = 200
6464
): Route {
6565
const url = `${TEST_SCHEME}://${TEST_HOST}${parent}${endpoint}`;
66-
console.log('here ', url);
6766
return mock(url, response, status);
6867
}

0 commit comments

Comments
 (0)