Skip to content

Commit

Permalink
Revert "feat: EXP add cross product identity matching"
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenfowler authored Feb 15, 2024
1 parent 28d4f8b commit ff9f1ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
8 changes: 1 addition & 7 deletions packages/internal/metrics/src/details.ts
Original file line number Diff line number Diff line change
@@ -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') => {
Expand All @@ -23,9 +23,3 @@ const setPublishableApiKeyFn = (publishableApiKey: string) => {
export const setPublishableApiKey = errorBoundary(
getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn),
);

export const getDetail = errorBoundary(
getGlobalisedValue('getDetail', getDetailFn),
);

export { Detail };
2 changes: 0 additions & 2 deletions packages/internal/metrics/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ export {
setEnvironment,
setPassportClientId,
setPublishableApiKey,
getDetail,
Detail,
} from './details';
24 changes: 4 additions & 20 deletions packages/passport/sdk/src/authManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<User> {
public async login(): Promise<User> {
return withPassportError<User>(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,
});

Expand All @@ -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<DeviceConnectResponse> {
public async loginWithDeviceFlow(): Promise<DeviceConnectResponse> {
return withPassportError<DeviceConnectResponse>(async () => {
const response = await axios.post<DeviceCodeResponse>(
`${this.config.authenticationDomain}/oauth/device/code`,
Expand All @@ -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);
Expand Down Expand Up @@ -366,7 +350,7 @@ export default class AuthManager {
return this.userManager.signoutSilentCallback(url);
}

public async forceUserRefresh(): Promise<User | null> {
public async forceUserRefresh() : Promise<User | null> {
return this.refreshTokenAndUpdatePromise();
}

Expand Down

0 comments on commit ff9f1ca

Please sign in to comment.