From c73cab2d03bb351ca65fdb9b7956307dca566ca2 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 8 Aug 2021 00:27:23 +0200 Subject: :lock: fix exposing user in channel.recipients --- src/models/Channel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/models/Channel.ts') diff --git a/src/models/Channel.ts b/src/models/Channel.ts index a77e492d..1dd05896 100644 --- a/src/models/Channel.ts +++ b/src/models/Channel.ts @@ -1,7 +1,7 @@ import { Schema, model, Types, Document } from "mongoose"; import db from "../util/Database"; import toBigInt from "../util/toBigInt"; -import { UserModel } from "./User"; +import { PublicUserProjection, UserModel } from "./User"; // @ts-ignore export interface AnyChannel extends Channel, DMChannel, TextChannel, VoiceChannel { @@ -42,7 +42,7 @@ ChannelSchema.virtual("recipients", { localField: "recipient_ids", foreignField: "id", justOne: false, - autopopulate: true, + autopopulate: { select: PublicUserProjection }, }); ChannelSchema.set("removeResponse", ["recipient_ids"]); -- cgit 1.5.1