This commit is contained in:
Erik 2023-05-15 22:37:42 +03:00
parent 3581ee12ab
commit 3032a8b83d
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68

View File

@ -16,6 +16,7 @@ import MongoStore from "connect-mongo";
import { MiddlewareFunction, Request, Response } from "../../../@types/Server.js";
import { NextFunction } from "express";
import { User } from "../structures/index.js";
import { inspect } from "node:util";
const OAuthLinks: { [key: string]: string } = {};
@ -246,6 +247,8 @@ class Authenticator {
// Has permission
if (user.hasPermission(permission, level))
return next();
this.#logger.debug(`Invalid perms ${permission}, ${level}\n${inspect(req.user.permissions)}`);
return res.status(403).send('Insufficient permissions');
};