From ff9f1cadd6171fe4812f8662c6627101d216c47c Mon Sep 17 00:00:00 2001 From: Hayden Fowler Date: Thu, 15 Feb 2024 15:05:02 +1100 Subject: [PATCH] Revert "feat: EXP add cross product identity matching" --- packages/internal/metrics/src/details.ts | 8 +------- packages/internal/metrics/src/index.ts | 2 -- packages/passport/sdk/src/authManager.ts | 24 ++++-------------------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/packages/internal/metrics/src/details.ts b/packages/internal/metrics/src/details.ts index e6e57c547b..afa01bdb67 100644 --- a/packages/internal/metrics/src/details.ts +++ b/packages/internal/metrics/src/details.ts @@ -1,6 +1,6 @@ import { errorBoundary } from './utils/errorBoundary'; import { Detail } from './utils/constants'; -import { storeDetail, getDetail as getDetailFn } from './utils/state'; +import { storeDetail } from './utils/state'; import { getGlobalisedValue } from './utils/globalise'; const setEnvironmentFn = (env: 'sandbox' | 'production') => { @@ -23,9 +23,3 @@ const setPublishableApiKeyFn = (publishableApiKey: string) => { export const setPublishableApiKey = errorBoundary( getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn), ); - -export const getDetail = errorBoundary( - getGlobalisedValue('getDetail', getDetailFn), -); - -export { Detail }; diff --git a/packages/internal/metrics/src/index.ts b/packages/internal/metrics/src/index.ts index 0de91ecc40..76a74778cd 100644 --- a/packages/internal/metrics/src/index.ts +++ b/packages/internal/metrics/src/index.ts @@ -4,6 +4,4 @@ export { setEnvironment, setPassportClientId, setPublishableApiKey, - getDetail, - Detail, } from './details'; diff --git a/packages/passport/sdk/src/authManager.ts b/packages/passport/sdk/src/authManager.ts index a5bbb8604d..3d7d4a6114 100644 --- a/packages/passport/sdk/src/authManager.ts +++ b/packages/passport/sdk/src/authManager.ts @@ -9,7 +9,6 @@ import axios from 'axios'; import DeviceCredentialsManager from 'storage/device_credentials_manager'; import * as crypto from 'crypto'; import jwt_decode from 'jwt-decode'; -import { getDetail, Detail } from '@imtbl/metrics'; import { isTokenExpired } from './utils/token'; import { PassportErrorType, withPassportError } from './errors/passportError'; import { @@ -154,19 +153,10 @@ export default class AuthManager { }); }; - /** - * login - * @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation. - */ - public async login(anonymousId?: string): Promise { + public async login(): Promise { return withPassportError(async () => { - const rid = getDetail(Detail.RUNTIME_ID); const popupWindowFeatures = { width: 410, height: 450 }; const oidcUser = await this.userManager.signinPopup({ - extraQueryParams: { - rid: rid || '', - third_party_a_id: anonymousId || '', - }, popupWindowFeatures, }); @@ -193,11 +183,7 @@ export default class AuthManager { ); } - /** - * loginWithDeviceFlow - * @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation. - */ - public async loginWithDeviceFlow(anonymousId?: string): Promise { + public async loginWithDeviceFlow(): Promise { return withPassportError(async () => { const response = await axios.post( `${this.config.authenticationDomain}/oauth/device/code`, @@ -209,12 +195,10 @@ export default class AuthManager { formUrlEncodedHeader, ); - const rid = getDetail(Detail.RUNTIME_ID); - return { code: response.data.user_code, deviceCode: response.data.device_code, - url: `${response.data.verification_uri_complete}${rid ? `&rid=${rid}` : ''}${anonymousId ? `&third_party_a_id=${anonymousId}` : ''}`, + url: response.data.verification_uri_complete, interval: response.data.interval, }; }, PassportErrorType.AUTHENTICATION_ERROR); @@ -366,7 +350,7 @@ export default class AuthManager { return this.userManager.signoutSilentCallback(url); } - public async forceUserRefresh(): Promise { + public async forceUserRefresh() : Promise { return this.refreshTokenAndUpdatePromise(); }