diff --git a/packages/better-auth/src/plugins/admin/call.ts b/packages/better-auth/src/plugins/admin/call.ts deleted file mode 100644 index e30fdb47d4..0000000000 --- a/packages/better-auth/src/plugins/admin/call.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { type UserWithRole } from "./admin"; -import { APIError, createAuthMiddleware, getSessionFromCtx } from "../../api"; -import { type Session } from "../../types"; - -export const adminMiddleware = createAuthMiddleware(async (ctx) => { - const session = await getSessionFromCtx(ctx); - if (!session?.session) { - throw new APIError("UNAUTHORIZED"); - } - return { - session, - } as { - session: { - user: UserWithRole; - session: Session; - }; - }; -});