fix some 401s to 403s

This commit is contained in:
zkldi
2021-06-26 00:10:44 +01:00
parent 398fa2a081
commit 28b89ea3aa
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ export const RequirePermissions =
req.url
}. ${missingPerms.join(", ")}`
);
return res.status(401).json({
return res.status(403).json({
success: false,
description: `You are missing the following permissions necessary for this request: ${missingPerms.join(
", "
@@ -7,7 +7,7 @@ export const RequireLoggedInSession: RequestHandler = (req, res, next) => {
if (!req.session.tachi?.userID) {
logger.info(`Received unauthorised request from ${req.ip} from ${req.originalUrl}`);
return res.status(401).json({
return res.status(403).json({
success: false,
description: `You are not authorised to perform this action.`,
});
@@ -42,7 +42,7 @@ export const RequireAuthedAsUser: RequestHandler = (req, res, next) => {
const user = req[SYMBOL_TachiData]!.requestedUser!;
if (req[SYMBOL_TachiAPIAuth].userID !== user.id) {
return res.status(401).json({
return res.status(403).json({
success: false,
description: "You are not authorised as this user.",
});