diff --git a/packages/sample-server/src/crypto-services/JwtSignServiceImpl.ts b/packages/sample-server/src/crypto-services/JwtSignServiceImpl.ts index 1d5f42b..5d0c22f 100644 --- a/packages/sample-server/src/crypto-services/JwtSignServiceImpl.ts +++ b/packages/sample-server/src/crypto-services/JwtSignServiceImpl.ts @@ -20,18 +20,10 @@ export class JwtSignServiceImpl implements VCLJwtSignService { jwtDescriptor: VCLJwtDescriptor, didJwk: VCLDidJwk, nonce: Nullish, - // eslint-disable-next-line no-unused-vars,@typescript-eslint/no-unused-vars + // eslint-disable-next-line unused-imports/no-unused-vars,no-unused-vars remoteCryptoServicesToken: Nullish ): Promise { - try { - const jwtJson = await generateSignedJwtFetcher(jwtDescriptor, didJwk, nonce); - return new Promise((resolve) => { - resolve(VCLJwt.fromEncodedJwt(jwtJson['compactJwt'] as string)); - }); - } catch (e) { - return new Promise((resolve, reject) => { - reject(e); - }); - } + const jwtJson = await generateSignedJwtFetcher(jwtDescriptor, didJwk, nonce); + return VCLJwt.fromEncodedJwt(jwtJson['compactJwt'] as string) } } diff --git a/packages/sample-server/src/crypto-services/JwtVerifyServiceImpl.ts b/packages/sample-server/src/crypto-services/JwtVerifyServiceImpl.ts index f6969eb..75cb36d 100644 --- a/packages/sample-server/src/crypto-services/JwtVerifyServiceImpl.ts +++ b/packages/sample-server/src/crypto-services/JwtVerifyServiceImpl.ts @@ -13,15 +13,7 @@ export class JwtVerifyServiceImpl implements VCLJwtVerifyService { jwt: VCLJwt, publicJwk: Nullish, ): Promise { - try { - const verificationJson = await verifyJwtFetcher(jwt, publicJwk); - return new Promise((resolve) => { - resolve(verificationJson['verified'] as boolean || false); - }); - } catch (e) { - return new Promise((resolve, reject) => { - reject(e); - }); - } + const verificationJson = await verifyJwtFetcher(jwt, publicJwk); + return verificationJson['verified'] as boolean || false } } diff --git a/packages/sample-server/src/crypto-services/KeyServiceImpl.ts b/packages/sample-server/src/crypto-services/KeyServiceImpl.ts index 9ffe0ad..afef67d 100644 --- a/packages/sample-server/src/crypto-services/KeyServiceImpl.ts +++ b/packages/sample-server/src/crypto-services/KeyServiceImpl.ts @@ -9,19 +9,7 @@ import { VCLDidJwk, VCLDidJwkDescriptor, VCLKeyService } from "@velocitycareerla import { generateDidJwkFetcher } from "./fetchers"; export class KeyServiceImpl implements VCLKeyService { - async generateDidJwk(didJwkDescriptor: VCLDidJwkDescriptor): Promise { - try { - const didJwkJson = await generateDidJwkFetcher( - didJwkDescriptor, - ); - return new Promise((resolve) => { - resolve(VCLDidJwk.fromJSON(didJwkJson)); - }); - } catch (e) { - return new Promise((resolve, reject) => { - reject(e); - }); - } + return VCLDidJwk.fromJSON(await generateDidJwkFetcher(didJwkDescriptor)); } } \ No newline at end of file diff --git a/packages/sample-server/src/routes/Routes.ts b/packages/sample-server/src/routes/Routes.ts index f8aa558..6b13058 100644 --- a/packages/sample-server/src/routes/Routes.ts +++ b/packages/sample-server/src/routes/Routes.ts @@ -77,7 +77,9 @@ export default async function routes(fastify) { "/getCredentialManifest", async (req, reply) => { reply.send( - await req.vclSdk.getCredentialManifest(credentialManifestDescriptorFromJson(req.body, req.didJwk)) + await req.vclSdk.getCredentialManifest( + credentialManifestDescriptorFromJson(req.body, req.didJwk) + ) ) } );