mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 09:42:43 +00:00
Change Not an Author to 401
This commit is contained in:
@@ -68,7 +68,7 @@ const api = {
|
|||||||
const isAuthor = stub?.authors?.includes(req.account?.username);
|
const isAuthor = stub?.authors?.includes(req.account?.username);
|
||||||
const isInvited = stub?.invitedAuthors?.includes(req.account?.username);
|
const isInvited = stub?.invitedAuthors?.includes(req.account?.username);
|
||||||
if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) {
|
if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) {
|
||||||
throw { name: 'Access Error', message: 'User is not an Author', status: 403, HBErrorCode: '03' };
|
throw { name: 'Access Error', message: 'User is not an Author', status: 401, HBErrorCode: '03' };
|
||||||
}
|
}
|
||||||
|
|
||||||
// If after all of that we still don't have a brew, throw an exception
|
// If after all of that we still don't have a brew, throw an exception
|
||||||
|
|||||||
Reference in New Issue
Block a user