Skip to content

Commit

Permalink
fix: migration from localstorage to idb (#608)
Browse files Browse the repository at this point in the history
* fix: migration from localstorage to idb

* test: use key ic- for test too
  • Loading branch information
peterpeterparker committed Aug 12, 2022
1 parent e0687a6 commit bbcb687
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/auth-client/src/index.test.ts
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-client/src/index.ts
Expand Up @@ -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) {
Expand Down

0 comments on commit bbcb687

Please sign in to comment.