forked from jsnbuchanan/crowd-funder-for-time-pwa
fix: update offerGiverDid to use credentialSubject.offeredBy
The offerGiverDid function was looking for offeredBy at the root level of the OfferVerifiableCredential, but it was moved to credentialSubject in our interface changes. This fix updates the function to look in the correct location while maintaining the same fallback behavior of using the issuer if offeredBy is not available. - Update path from claim.offeredBy to claim.credentialSubject.offeredBy - Remove unnecessary string type cast - Keep issuer fallback behavior unchanged
This commit is contained in:
@@ -389,10 +389,10 @@ export function offerGiverDid(
|
||||
let giver;
|
||||
const claim = veriClaim.claim as OfferVerifiableCredential;
|
||||
if (
|
||||
claim.offeredBy?.identifier &&
|
||||
!serverUtil.isHiddenDid(claim.offeredBy.identifier as string)
|
||||
claim.credentialSubject.offeredBy?.identifier &&
|
||||
!serverUtil.isHiddenDid(claim.credentialSubject.offeredBy.identifier)
|
||||
) {
|
||||
giver = claim.offeredBy.identifier;
|
||||
giver = claim.credentialSubject.offeredBy.identifier;
|
||||
} else if (veriClaim.issuer && !serverUtil.isHiddenDid(veriClaim.issuer)) {
|
||||
giver = veriClaim.issuer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user