summary refs log tree commit diff
path: root/api/src/routes/auth/register.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-31 17:56:33 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-31 17:56:33 +0200
commit42a50c0674a7165d1a4d57a09482cc3b40bd5e73 (patch)
tree934a4d50b58f940665514b00a1e586bba8efcf53 /api/src/routes/auth/register.ts
parent:bug: fix message sending (diff)
downloadserver-42a50c0674a7165d1a4d57a09482cc3b40bd5e73.tar.xz
:zap: use insert instead of save
Diffstat (limited to 'api/src/routes/auth/register.ts')
-rw-r--r--api/src/routes/auth/register.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts

index b41ef82c..8bcecda1 100644 --- a/api/src/routes/auth/register.ts +++ b/api/src/routes/auth/register.ts
@@ -181,10 +181,11 @@ router.post( // appearently discord doesn't save the date of birth and just calculate if nsfw is allowed // if nsfw_allowed is null/undefined it'll require date_of_birth to set it to true/false - const user = await new User({ + const user = { created_at: new Date(), username: adjusted_username, discriminator, + id: Snowflake.generate(), bot: false, system: false, desktop: false, @@ -204,8 +205,10 @@ router.post( hash: adjusted_password, valid_tokens_since: new Date() }, - settings: defaultSettings - }).save(); + settings: defaultSettings, + fingerprints: [] + }; + await User.insert(user); return res.json({ token: await generateToken(user.id) }); }