Skip to Main Content

Cloud Platform

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

401- Custom Message in MCS

Full Stack DeveloperAug 29 2017 — edited Aug 30 2017

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

Comments