diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-02 21:31:44 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-02 21:31:44 +0200 |
commit | 4c4bc248a5456e95b11102ee293fc5e7b37a83fa (patch) | |
tree | 984b7b8c6528d3a1a4bddeb81a2101e6258906c3 /api/src/routes/auth | |
parent | Merge branch 'master' of https://github.com/fosscord/fosscord-api (diff) | |
download | server-4c4bc248a5456e95b11102ee293fc5e7b37a83fa.tar.xz |
:bug: fix entity missing an id (replace .insert with new Entity().save)
Diffstat (limited to 'api/src/routes/auth')
-rw-r--r-- | api/src/routes/auth/register.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts index 8bcecda1..19c9c70f 100644 --- a/api/src/routes/auth/register.ts +++ b/api/src/routes/auth/register.ts @@ -181,7 +181,7 @@ 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 = { + const user = await new User({ created_at: new Date(), username: adjusted_username, discriminator, @@ -207,8 +207,7 @@ router.post( }, settings: defaultSettings, fingerprints: [] - }; - await User.insert(user); + }).save(); return res.json({ token: await generateToken(user.id) }); } |