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
commitf68b3027e377eac0e8e495123f864fb4b1da0614 (patch)
tree44dcd160a905a9a1bdc0c934e9f52dd709464b9a /api/src/routes/auth/register.ts
parent:bug: fix message sending (diff)
downloadserver-f68b3027e377eac0e8e495123f864fb4b1da0614.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) });
 	}