From 36b59d1908a3e45a1a4088220f0accab9be93d52 Mon Sep 17 00:00:00 2001 From: linkability <146661751+linkability@users.noreply.github.com> Date: Thu, 5 Oct 2023 01:41:09 +0100 Subject: [PATCH] fix: :bug: it does not import Accounts --- src/server/lib/middleware.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/lib/middleware.ts b/src/server/lib/middleware.ts index a1d5fb2..c51888c 100644 --- a/src/server/lib/middleware.ts +++ b/src/server/lib/middleware.ts @@ -1,4 +1,4 @@ -import { Account } from "./accounts"; +import * as Accounts from "./accounts"; import express, { type RequestHandler } from "express" import ServeError from "../lib/errors"; import * as auth from "./auth"; @@ -78,7 +78,7 @@ export const noAPIAccess: RequestHandler = function(req, res, next) { * @returns Express middleware */ -export const noAPIAccessIf = function(condition: (acc:Account, token:string) => boolean):RequestHandler { +export const noAPIAccessIf = function(condition: (acc:Accounts.Account, token:string) => boolean):RequestHandler { return function(req, res, next) { let reqToken = auth.tokenFor(req) if (auth.getType(reqToken) == "App" && !condition(res.locals.acc, reqToken)) ServeError(res, 403, "apps are not allowed to access this endpoint")