mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-04 21:08:09 +03:00
fix some 401s to 403s
This commit is contained in:
@@ -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.",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user