Skip to content

Commit

Permalink
catch error if clientmetada is missing in /authorize endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed Jun 6, 2024
1 parent 1cb5d25 commit db5578f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions routes/codeFlowJwtRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ codeFlowRouter.get("/authorize", async (req, res) => {
const nonce = req.query.nonce;
const codeChallenge = decodeURIComponent(req.query.code_challenge);
const codeChallengeMethod = req.query.code_challenge_method; //this should equal to S256
try {
const clientMetadata = JSON.parse(
decodeURIComponent(req.query.client_metadata)
);
} catch (error) {
console.log("client_metadata was missing");
console.log(error);
}

const clientMetadata = JSON.parse(
decodeURIComponent(req.query.client_metadata)
);
//validations
let errors = [];
if (!authorizationDetails) {
Expand Down

0 comments on commit db5578f

Please sign in to comment.