Skip to content

Commit

Permalink
added generic_credential_image property in CredentialView
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmanos committed Oct 8, 2024
1 parent de3936c commit 143f072
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/authorization/consentPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export async function consent(req: Request, res: Response, _next: NextFunction)
);
}

console.log("All credential views = ", allCredentialViews);

if (req.method == "POST") {
try {
// at the moment the selected_credential_id_list is useless because only one credential per authorization request is supported
Expand Down
2 changes: 1 addition & 1 deletion src/authorization/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export type CredentialView = {
credential_id: string,
credential_supported_object: any;
view: CategorizedRawCredentialView;
deferredFlow: boolean;
credential_image: string; // base64
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export class VIDSupportedCredentialSdJwt implements SupportedCredentialProtocol
credential_id: this.getId(),
credential_supported_object: this.exportCredentialSupportedObject(),
view: rowsObject,
deferredFlow: false,
}
})
return credentialViews[0];
Expand Down
2 changes: 1 addition & 1 deletion views/issuer/consent.pug
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ block layout-content
for credential, index in credentialViewList
.credential-card
input(type="hidden" name="selected_credential_id_list[]" id=`${credential.credential_id}_${index}` value=`${credential.credential_id}` disabled)
a.credential.toggle-card(id=`${credential.credential_id}_${index}` style=`position:relative; background-image: url(${credential.credential_supported_object.display[0].background_image.uri});`)
a.credential.toggle-card(id=`${credential.credential_id}_${index}` style=`position:relative; background-image: url(${credential.credentialImage});`)
if grant_type == "authorization_code"
i.is-selected.fa.fa-check-circle-o(aria-hidden="true" style="display: none;")
i.is-not-selected.fa.fa-circle-o(aria-hidden="true")
Expand Down

0 comments on commit 143f072

Please sign in to comment.