diff --git a/src/api/models/user.ts b/src/api/models/user.ts index d3875a65b..08d7fbb8c 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -58,6 +58,7 @@ export type IUser = { pinned_post_id: mongo.ObjectID; is_suspended: boolean; keywords: string[]; + host: string; account: { keypair: string; email: string; diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index 690f3001c..a4c06b5f5 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -119,6 +119,7 @@ export default async (req: express.Request, res: express.Response) => { drive_capacity: 1073741824, // 1GB username: username, username_lower: username.toLowerCase(), + host: null, account: { keypair: generateKeypair(), token: secret, diff --git a/tools/migration/node.1522066477.user-account-keypair.js b/tools/migration/node.1522066477.user-account-keypair.js index 4a968aae2..effea137c 100644 --- a/tools/migration/node.1522066477.user-account-keypair.js +++ b/tools/migration/node.1522066477.user-account-keypair.js @@ -6,9 +6,7 @@ const updates = []; User.find({}).each(function(user) { updates.push(User.update({ _id: user._id }, { $set: { - account: { - keypair: generate(), - } + 'account.keypair': generate(), } })); }).then(function () { diff --git a/tools/migration/shell.1522116709.user-host.js b/tools/migration/shell.1522116709.user-host.js new file mode 100644 index 000000000..b354709a6 --- /dev/null +++ b/tools/migration/shell.1522116709.user-host.js @@ -0,0 +1 @@ +db.users.update({ }, { $set: { host: null } }, { multi: true });