mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Make the 401 error format consistent
issue #5499 - Update error object being sent from authenticate method
This commit is contained in:
parent
b8415e8b90
commit
6559f25ebe
1 changed files with 6 additions and 6 deletions
|
@ -120,13 +120,13 @@ middleware = {
|
|||
}
|
||||
// Generate a JSON response reflecting authentication status
|
||||
if (!user) {
|
||||
var msg = {
|
||||
type: 'error',
|
||||
message: 'Please Sign In',
|
||||
status: 'passive'
|
||||
var error = {
|
||||
code: 401,
|
||||
errorType: 'NoPermissionError',
|
||||
message: 'Please Sign In'
|
||||
};
|
||||
res.status(401);
|
||||
return res.send(msg);
|
||||
|
||||
return apiErrorHandlers.errorHandler(error, req, res, next);
|
||||
}
|
||||
// TODO: figure out, why user & authInfo is lost
|
||||
req.authInfo = info;
|
||||
|
|
Loading…
Reference in a new issue