var err = new Error('Authentication');
err.message = "Couldn't request accessToken";
err.remoteIp = options.hostname;
err.remotePort = options.port;
err.path = options.path;
Currently in Passport I get an unhandled exception response if the credentials are incorrect. In some of the other apps we've started to use the JSON API spec for errors. Could we look at returning an errors collection in passport also?
For example:
{
"errors": [
{
"status": "Not Found",
"code": "",
"title": "URL Not Found",
"details": "The request for URL '<url>' returned a 404."
}
]
}
We have at least two error cases to handle, to match the existing auth token request in Web:
Currently in Web these are handled as follows:
Currently in Passport I get an unhandled exception response if the credentials are incorrect. In some of the other apps we've started to use the JSON API spec for errors. Could we look at returning an errors collection in passport also?
For example: