diff --git a/apps/wallet/src/utils/auth/logout.ts b/apps/wallet/src/utils/auth/logout.ts index 5295560a0..11f8e1f0e 100644 --- a/apps/wallet/src/utils/auth/logout.ts +++ b/apps/wallet/src/utils/auth/logout.ts @@ -4,9 +4,12 @@ import { appActions } from 'state/app'; import { storage } from '../storage'; +import { tkey } from './w3a'; + export const logout = async () => { await firebase.auth().signOut(); await engine.clear(); await storage.clearAllDocs(); appActions.cleanupAfterLogOut(); + tkey.shares = {}; }; diff --git a/apps/wallet/src/utils/auth/logout.web.ts b/apps/wallet/src/utils/auth/logout.web.ts index 8895033e2..71b71531c 100644 --- a/apps/wallet/src/utils/auth/logout.web.ts +++ b/apps/wallet/src/utils/auth/logout.web.ts @@ -5,9 +5,12 @@ import { appActions } from 'state/app'; import { auth } from '../firebase/index.web'; import { storage } from '../storage'; +import { tkey } from './w3a'; + export const logout = async () => { await signOut(auth()); await engine.clear(); await storage.clearAllDocs(); appActions.cleanupAfterLogOut(); + tkey.shares = {}; }; diff --git a/apps/wallet/src/utils/auth/w3a/index.ts b/apps/wallet/src/utils/auth/w3a/index.ts index 5e843ec2f..783008cb3 100644 --- a/apps/wallet/src/utils/auth/w3a/index.ts +++ b/apps/wallet/src/utils/auth/w3a/index.ts @@ -1,7 +1,6 @@ import type { GenerateNewShareResult } from '@tkey/common-types'; -import { logger } from '@walless/core'; -import { importDeviceShare, initTkey, storeDeviceShare } from './tkey'; +import { initTkey, storeDeviceShare } from './tkey'; export * from './core'; @@ -27,11 +26,11 @@ export enum ThresholdResult { } export const importAvailableShares = async (): Promise => { - try { - await importDeviceShare(tkey); - } catch (e) { - logger.error('Existing share not available, skip..', e); - } + // try { + // await importDeviceShare(tkey); + // } catch (e) { + // logger.error('Existing share not available, skip..', e); + // } const { requiredShares, totalShares } = tkey.getKeyDetails(); const isReady = requiredShares <= 0;