I have the following code…
app.get(
"/secure",
oidc.claimCheck((req, claims) => {
console.log(`The roles are ${JSON.stringify(claims)}`);
return claims["https://secondave.net/roles"].includes("editor");
}),
(req, res)=>{
// TODO: Add a new post
res.send("Claim worked");
}
)
But in this case I would like to redirect to a specific url (in this case root /) when the user is unauthorized. This way it just redirects back to Auth0 site