Skip to content

Commit

Permalink
fix(core): Remove legacy non-account urns from getAppData. (#2624)
Browse files Browse the repository at this point in the history
  • Loading branch information
betimshahini authored Aug 19, 2023
1 parent 3671c90 commit 5bb4fc0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions platform/authorization/src/jsonrpc/methods/getAppData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { initAuthorizationNodeByName } from '../../nodes'
import { AppData } from '@proofzero/types/application'
import type { AppDataType } from '@proofzero/types/application'
import type { IdentityURN } from '@proofzero/urns/identity'
import { AccountURNSpace } from '@proofzero/urns/account'

export const GetAppDataInput = z.object({
clientId: z.string(),
Expand Down Expand Up @@ -42,5 +43,11 @@ export const getAppDataMethod = async ({

const appData =
(await node.storage.get<AppDataType>('appData')) || ({} as AppDataType)

//Remove legacy, non-account urns from result
if (appData && Array.isArray(appData.smartWalletSessionKeys))
appData.smartWalletSessionKeys = appData.smartWalletSessionKeys.filter(
(scwk) => AccountURNSpace.is(scwk.urn)
)
return appData
}

0 comments on commit 5bb4fc0

Please sign in to comment.