From fc228a2e85d72e0e1118d71ed8ce6252f4bc273b Mon Sep 17 00:00:00 2001 From: nklomp Date: Fri, 10 Mar 2023 01:33:54 +0100 Subject: [PATCH] fix: bbs+ fixes and updates --- packages/vc-handler-ld-local/src/ld-suite-loader.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/vc-handler-ld-local/src/ld-suite-loader.ts b/packages/vc-handler-ld-local/src/ld-suite-loader.ts index cf3a1c8b8..f9d034238 100644 --- a/packages/vc-handler-ld-local/src/ld-suite-loader.ts +++ b/packages/vc-handler-ld-local/src/ld-suite-loader.ts @@ -11,7 +11,8 @@ export class LdSuiteLoader { const veramoKeyType = obj.getSupportedVeramoKeyType() const verificationType = obj.getSupportedVerificationType() if (this.signatureMap[veramoKeyType]) { - throw Error(`Cannot register 2 suites for the same type ${veramoKeyType}`) + console.log(`Registered another signature suite ${obj} for key type: ${veramoKeyType} overriding the old one. Previous one: ${this.signatureMap[veramoKeyType]}`) + // throw Error(`Cannot register 2 suites for the same type ${veramoKeyType}`) } this.signatureMap[veramoKeyType] = obj if (verificationType !== veramoKeyType) { @@ -34,10 +35,10 @@ export class LdSuiteLoader { } getAllSignatureSuites(): SphereonLdSignature[] { - return Object.values(this.signatureMap) + return [...new Set(Object.values(this.signatureMap))] } getAllSignatureSuiteTypes(): string[] { - return Object.values(this.signatureMap).map((x) => x.getSupportedVerificationType()) + return [...new Set(Object.values(this.signatureMap).map((x) => x.getSupportedVerificationType()))] } }