Hey community!
I want to know how to return a custom error message from Authorizer on serverless Node JS lambda.
I tried this solution but it didnt work:
Along with a 403 code, I need to send extra info in the response body for my business logic on the frontend. I want to do the same we do on Express middlewares, where you can return any response you like and apply it to any endpoint.
Instead, im only able to return this fixed message:
{
“statusCode”: 403,
“error”: “Forbidden”,
“message”: “User is not authorized to access this resource”
}
Hope someone can help me with that.
Thanks!