401- Custom Message in MCS
Summary
401- Custom Message in MCSContent
Hi,
In my custom API i am returning status 401 with a custom message, however, when we test the api we get only 401 unauthorized status code and not the custom message. How can we achieve this?
In the code, if the authenticateToken is 401, I am not able to return my custom message.
ut . h
enticateToken.statusCode
var result = { statusCode:authenticateToken.statusCode, success:false, message:authenticateToken.message }; console.log("Response Object:"+ JSON.stringify(result,undefined,2)); res.status(authenticateToken.statusCode).send(result);
Regards
1