From 6e6afd274b792225ee8d142399f117b6ff73c140 Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:21:33 -0700 Subject: [PATCH] api-v1: fix middleware func --- src/server/lib/middleware.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/lib/middleware.ts b/src/server/lib/middleware.ts index 812bc5a..a4c609c 100644 --- a/src/server/lib/middleware.ts +++ b/src/server/lib/middleware.ts @@ -70,6 +70,7 @@ export const requiresPermissions = function(...tokenPermissions: auth.TokenPermi export const noAPIAccess: RequestHandler = function(req, res, next) { if (auth.getType(auth.tokenFor(req)) == "App") ServeError(res, 403, "apps are not allowed to access this endpoint") else next() +} /** * @description Blocks requests based on whether or not the token being used to access the route is of type `User` unless a condition is met. @@ -83,4 +84,4 @@ export const noAPIAccessIf = function(condition: (acc:Account, token:string) => if (auth.getType(reqToken) == "App" && !condition(res.locals.acc, reqToken)) ServeError(res, 403, "apps are not allowed to access this endpoint") else next() } -}} \ No newline at end of file +} \ No newline at end of file