diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-08 04:27:28 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-08-09 23:28:27 +0200 |
commit | d52d9c62fc30e31e2c01bf6b63f9aedebdde216f (patch) | |
tree | e0f7fd130aeeecb9964e1f359eea6b4e124de7da /util/src/entities/User.ts | |
parent | Clean dependencies (diff) | |
download | server-d52d9c62fc30e31e2c01bf6b63f9aedebdde216f.tar.xz |
Bunch of fixes and improvements, everything appears to work now
Diffstat (limited to 'util/src/entities/User.ts')
-rw-r--r-- | util/src/entities/User.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts index 7d5dc5a6..81017c2d 100644 --- a/util/src/entities/User.ts +++ b/util/src/entities/User.ts @@ -255,7 +255,7 @@ export class User extends BaseClass { // if nsfw_allowed is null/undefined it'll require date_of_birth to set it to true/false const language = req.language === "en" ? "en-US" : req.language || "en-US"; - const user = new User({ + const user = Object.assign(new User(), { created_at: new Date(), username: username, discriminator, @@ -275,7 +275,7 @@ export class User extends BaseClass { disabled: false, deleted: false, email: email, - rights: "0", // TODO: grant rights correctly, as 0 actually stands for no rights at all + rights: Config.get().register.defaultRights, // TODO: grant rights correctly, as 0 actually stands for no rights at all nsfw_allowed: true, // TODO: depending on age public_flags: "0", flags: "0", // TODO: generate @@ -289,6 +289,8 @@ export class User extends BaseClass { notes: {}, }); + console.log("new user") + console.log(user); await user.save(); setImmediate(async () => { |