summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:30:04 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 04:30:04 +0200
commitaf6f9b57ad4a7fd05d4ffa19440012084fb5071f (patch)
treecda44ceacc765b39370af242978fb060399dee9c
parent:bug: fix login (diff)
downloadserver-af6f9b57ad4a7fd05d4ffa19440012084fb5071f.tar.xz
:bug: fix user guilds
-rw-r--r--src/routes/auth/register.ts3
-rw-r--r--src/util/User.ts4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/routes/auth/register.ts b/src/routes/auth/register.ts

index ce54b940..9543e814 100644 --- a/src/routes/auth/register.ts +++ b/src/routes/auth/register.ts
@@ -165,6 +165,8 @@ router.post( }); } + // TODO: save date_of_birth + // constructing final user object // TODO fix: // @ts-ignore @@ -179,6 +181,7 @@ router.post( mfa_enabled: false, verified: false, email: adjusted_email, + nsfw_allowed: true, // TODO: depending on age flags: 0n, // TODO: generate default flags guilds: [], user_data: { diff --git a/src/util/User.ts b/src/util/User.ts
index 1b13e153..3658e46d 100644 --- a/src/util/User.ts +++ b/src/util/User.ts
@@ -16,7 +16,9 @@ export async function getPublicUser(user_id: bigint, additional_fields?: any) { ...PublicUserProjection, ...additional_fields, } - ).exec(); + ) + .lean() + .exec(); if (!user) throw new HTTPError("User not found", 404); return user; }