From bfcbe8d593c51756f85b29d7d71e14d21f4c6cd3 Mon Sep 17 00:00:00 2001 From: "Carmen(Jia) Liu" Date: Mon, 30 Oct 2023 12:08:43 +1000 Subject: [PATCH] [ID-1124]Remove the useCachedSession as a option in connectImx --- packages/passport/sdk/src/Passport.test.ts | 11 ----------- packages/passport/sdk/src/Passport.ts | 6 +----- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/packages/passport/sdk/src/Passport.test.ts b/packages/passport/sdk/src/Passport.test.ts index c4a2a7ff74..1175e5b589 100644 --- a/packages/passport/sdk/src/Passport.test.ts +++ b/packages/passport/sdk/src/Passport.test.ts @@ -126,17 +126,6 @@ describe('Passport', () => { expect(result).toBe(passportImxProvider); expect(getProviderMock).toHaveBeenCalled(); }); - - it('should call getProviderSilent if useCachedSession is true', async () => { - const passportImxProvider = {} as PassportImxProvider; - getProviderSilentMock.mockResolvedValue(passportImxProvider); - - const result = await passport.connectImx({ useCachedSession: true }); - - expect(result).toBe(passportImxProvider); - expect(getProviderSilentMock).toHaveBeenCalled(); - expect(getProviderMock).not.toHaveBeenCalled(); - }); }); describe('connectImxSilent', () => { diff --git a/packages/passport/sdk/src/Passport.ts b/packages/passport/sdk/src/Passport.ts index 0f855a37c0..2361fcf2bb 100644 --- a/packages/passport/sdk/src/Passport.ts +++ b/packages/passport/sdk/src/Passport.ts @@ -76,11 +76,7 @@ export class Passport { return this.passportImxProviderFactory.getProviderSilent(); } - public async connectImx(options?: { useCachedSession: boolean }): Promise { - const { useCachedSession = false } = options || {}; - if (useCachedSession) { - return this.passportImxProviderFactory.getProviderSilent(); - } + public async connectImx(): Promise { return this.passportImxProviderFactory.getProvider(); }