diff --git a/web/src/util/account.ts b/web/src/util/account.ts deleted file mode 100644 index 8f8ddc3..0000000 --- a/web/src/util/account.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { deriveDeviceKey, getDeviceId } from "./deviceId"; -import { encryptToken } from "./token"; - -const storeTokensForAccount = async ( - accountId: string, - accessToken: string, - refreshToken: string -) => { - const deviceKeyId = await getDeviceId(); - const key = await deriveDeviceKey(deviceKeyId); - - const access = await encryptToken(accessToken, key); - const refresh = await encryptToken(refreshToken, key); - - const entry = { - accountId, - label: `Account for ${accountId}`, - access: { - data: Array.from(new Uint8Array(access.cipherText)), - iv: Array.from(access.iv), - }, - refresh: { - data: Array.from(new Uint8Array(refresh.cipherText)), - iv: Array.from(refresh.iv), - }, - updatedAt: new Date().toISOString(), - }; - - // Save this `entry` in IndexedDB (or use a localforage wrapper) -};