Skip to content

Commit

Permalink
fix presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eike-hass committed Jun 4, 2024
1 parent 4240037 commit 14ecf03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion backend/src/webapp/webapp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ export class WebAppService {

this.logger.debug(`validation response`, validationResponse);

await this.webAppGateway.presentation(sessionId, presentation, scope);
// TODO check validation response

await this.webAppGateway.presentation(
sessionId,
JSON.parse(validationResponse.credentials[0].credential), //TODO handle multiple credentials
scope,
);
}

async requestCredential(
Expand Down
2 changes: 1 addition & 1 deletion web/src/context/globalState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function GlobalStateProvider({ children }: any) {
dispatch({
type: Actions.ADD_CREDENTIAL,
scope: data.scope,
credential: data.credential.vc
credential: data.credential
});
cb();
})
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Company/CompanyData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const CompanyData: React.FC = ({ history, match }: any) => {

useEffect(() => {
if(!state[Scopes.CompanyHouse]?.credentials.length) return;
const relevantCredential = state[Scopes.CompanyHouse].credentials.filter((c: any) => c.credential.type.includes("UniversityDegreeCredential"))?.[0]?.credential;
const relevantCredential = state[Scopes.CompanyHouse].credentials.filter((c: any) => c.credential?.type.includes("UniversityDegreeCredential"))?.[0]?.credential;
console.log(relevantCredential)
if (!relevantCredential) return;
setPrefilledData({
Expand Down

0 comments on commit 14ecf03

Please sign in to comment.