Skip to content

Commit

Permalink
handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmanos committed Apr 2, 2024
1 parent 425202e commit 989a5f6
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/authorization/consentPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@ export async function consent(req: Request, res: Response, _next: NextFunction)
const allCredentialViews = await getAllCredentialViews(req.authorizationServerState);

if (SKIP_CONSENT) {
return await openidForCredentialIssuingAuthorizationServerService.sendAuthorizationResponse(
{req, res},
req.authorizationServerState.id,
req.authorizationServerState.authorization_details
);
try {
return await openidForCredentialIssuingAuthorizationServerService.sendAuthorizationResponse(
{req, res},
req.authorizationServerState.id,
req.authorizationServerState.authorization_details
);
}
catch(err) {
console.error(err);
return res.render('error', {
code: 123,
msg: "Could not send authorization response",
lang: req.lang,
locale: locale[req.lang]
});
}

}

if (req.method == "POST") {
Expand Down

0 comments on commit 989a5f6

Please sign in to comment.