From 4636a553728c095b5e9b7f264febe99fea3eb1b0 Mon Sep 17 00:00:00 2001 From: Jose Bravo Date: Fri, 13 Sep 2024 17:03:45 +0200 Subject: [PATCH] fix: return error response to avoid hanging Signed-off-by: Jose Bravo --- .../src/openid4vc-issuer/router/accessTokenEndpoint.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/openid4vc/src/openid4vc-issuer/router/accessTokenEndpoint.ts b/packages/openid4vc/src/openid4vc-issuer/router/accessTokenEndpoint.ts index 762ecb5cf3..53ddcc85bf 100644 --- a/packages/openid4vc/src/openid4vc-issuer/router/accessTokenEndpoint.ts +++ b/packages/openid4vc/src/openid4vc-issuer/router/accessTokenEndpoint.ts @@ -206,7 +206,7 @@ export function verifyTokenRequest(options: { preAuthorizedCodeExpirationInSecon } } catch (error) { if (error instanceof TokenError) { - sendErrorResponse( + return sendErrorResponse( response, agentContext.config.logger, error.statusCode, @@ -214,7 +214,7 @@ export function verifyTokenRequest(options: { preAuthorizedCodeExpirationInSecon error.getDescription() ) } else { - sendErrorResponse(response, agentContext.config.logger, 400, TokenErrorResponse.invalid_request, error) + return sendErrorResponse(response, agentContext.config.logger, 400, TokenErrorResponse.invalid_request, error) } }