diff --git a/localenv/mock-account-servicing-entity/app/lib/types.ts b/localenv/mock-account-servicing-entity/app/lib/types.ts index cb54affa08..5a8350be2a 100644 --- a/localenv/mock-account-servicing-entity/app/lib/types.ts +++ b/localenv/mock-account-servicing-entity/app/lib/types.ts @@ -28,11 +28,6 @@ export interface Access { limits?: AccessLimit } -export interface SubjectId { - id: string - format: string -} - export type InstanceConfig = { name: string logo: string diff --git a/localenv/mock-account-servicing-entity/app/routes/mock-idp._index.tsx b/localenv/mock-account-servicing-entity/app/routes/mock-idp._index.tsx index 3a4fe62ace..3203582436 100644 --- a/localenv/mock-account-servicing-entity/app/routes/mock-idp._index.tsx +++ b/localenv/mock-account-servicing-entity/app/routes/mock-idp._index.tsx @@ -8,7 +8,7 @@ import type { Dispatch, SetStateAction } from 'react' import { useEffect, useState } from 'react' import { Button } from '~/components' import { ApiClient } from '~/lib/apiClient' -import type { Access, InstanceConfig, SubjectId } from '~/lib/types' +import type { Access, InstanceConfig } from '~/lib/types' import { CONFIG } from '~/lib/parse_config.server' interface ConsentScreenContext { @@ -20,7 +20,7 @@ interface ConsentScreenContext { returnUrl: string accesses: Array | null outgoingPaymentAccess: Access | null - subjectId: SubjectId | null + subjectId: string | null price: GrantAmount | null costToUser: GrantAmount | null errors: Array @@ -64,7 +64,7 @@ function ConsentScreenBody({ interactId: string nonce: string returnUrl: string - subjectId: SubjectId | null + subjectId: string | null }) { const chooseConsent = (accept: boolean) => { const href = new URL(returnUrl) @@ -82,7 +82,7 @@ function ConsentScreenBody({ {subjectId && (

{thirdPartyName} is asking you to confirm ownership of{' '} - {subjectId.id}. + {subjectId}.

)} @@ -365,14 +365,15 @@ export default function ConsentScreen({ idpSecretParam }: ConsentScreenProps) { : AmountType.UNLIMITED ) } - returnUrlObject.searchParams.append( - 'subjectId', - response.payload.subject.sub_ids[0]?.id ?? null - ) + + const subjectId = response.payload.subject?.sub_ids[0]?.id ?? null + if (subjectId) { + returnUrlObject.searchParams.append('subjectId', subjectId) + } setCtx({ ...ctx, accesses: response.payload.access, - subjectId: response.payload.subject.sub_ids[0], + subjectId, outgoingPaymentAccess: outgoingPaymentAccess, thirdPartyName: ctx.thirdPartyName, thirdPartyUri: ctx.thirdPartyUri,