Skip to content

Commit

Permalink
prevent crash if invalid request is sent
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed May 31, 2024
1 parent 75969c8 commit 09a5695
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ router.post("/credential", async (req, res) => {
// Accessing the body data
const requestBody = req.body;
const format = requestBody.format;
const requestedCredentials = requestBody.credential_definition.type; //removed requestBody.types to conform to RFC001
const requestedCredentials = requestBody.credential_definition
? requestBody.credential_definition.type
: null; //removed requestBody.types to conform to RFC001
//TODO valiate bearer header
let decodedWithHeader;
let decodedHeaderSubjectDID;
Expand Down

0 comments on commit 09a5695

Please sign in to comment.