From 3032a8b83de0cf82895f5e8fa238a5005db3240b Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 15 May 2023 22:37:42 +0300 Subject: [PATCH] debug --- src/server/middleware/Authenticator.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/middleware/Authenticator.ts b/src/server/middleware/Authenticator.ts index c4f43b8..d75973e 100644 --- a/src/server/middleware/Authenticator.ts +++ b/src/server/middleware/Authenticator.ts @@ -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'); };