From bbcb6870e1b84739c0206cc0bcc80cd1c8dfa16e Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 12 Aug 2022 17:56:00 +0200 Subject: [PATCH] fix: migration from localstorage to idb (#608) * fix: migration from localstorage to idb * test: use key ic- for test too --- packages/auth-client/src/index.test.ts | 2 +- packages/auth-client/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/auth-client/src/index.test.ts b/packages/auth-client/src/index.test.ts index e58febc03..8f6f96a0f 100644 --- a/packages/auth-client/src/index.test.ts +++ b/packages/auth-client/src/index.test.ts @@ -612,7 +612,7 @@ describe('Migration from localstorage', () => { expect(storage.set as jest.Mock).toBeCalledTimes(0); }); it('should migrate storage from localstorage', async () => { - const localStorage = new LocalStorage('ic'); + const localStorage = new LocalStorage(); const storage: AuthClientStorage = { remove: jest.fn(), get: jest.fn(), diff --git a/packages/auth-client/src/index.ts b/packages/auth-client/src/index.ts index 3b5dacabd..323bbfb3d 100644 --- a/packages/auth-client/src/index.ts +++ b/packages/auth-client/src/index.ts @@ -198,7 +198,7 @@ export class AuthClient { if (!maybeIdentityStorage) { // Attempt to migrate from localstorage try { - const fallbackLocalStorage = new LocalStorage('ic'); + const fallbackLocalStorage = new LocalStorage(); const localChain = await fallbackLocalStorage.get(KEY_STORAGE_DELEGATION); const localKey = await fallbackLocalStorage.get(KEY_STORAGE_KEY); if (localChain && localKey) {