diff options
Diffstat (limited to 'server/models/account')
-rw-r--r-- | server/models/account/account.ts | 19 | ||||
-rw-r--r-- | server/models/account/user.ts | 6 |
2 files changed, 7 insertions, 18 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 2b04acd86..09cada096 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts | |||
@@ -47,7 +47,7 @@ export enum ScopeNames { | |||
47 | attributes: [ 'id', 'name' ], | 47 | attributes: [ 'id', 'name' ], |
48 | include: [ | 48 | include: [ |
49 | { | 49 | { |
50 | attributes: [ 'id', 'uuid', 'preferredUsername', 'url', 'serverId', 'avatarId' ], | 50 | attributes: [ 'id', 'preferredUsername', 'url', 'serverId', 'avatarId' ], |
51 | model: ActorModel.unscoped(), | 51 | model: ActorModel.unscoped(), |
52 | required: true, | 52 | required: true, |
53 | where: whereActor, | 53 | where: whereActor, |
@@ -180,22 +180,6 @@ export class AccountModel extends Model<AccountModel> { | |||
180 | return AccountModel.findByPk(id, { transaction }) | 180 | return AccountModel.findByPk(id, { transaction }) |
181 | } | 181 | } |
182 | 182 | ||
183 | static loadByUUID (uuid: string) { | ||
184 | const query = { | ||
185 | include: [ | ||
186 | { | ||
187 | model: ActorModel, | ||
188 | required: true, | ||
189 | where: { | ||
190 | uuid | ||
191 | } | ||
192 | } | ||
193 | ] | ||
194 | } | ||
195 | |||
196 | return AccountModel.findOne(query) | ||
197 | } | ||
198 | |||
199 | static loadByNameWithHost (nameWithHost: string) { | 183 | static loadByNameWithHost (nameWithHost: string) { |
200 | const [ accountName, host ] = nameWithHost.split('@') | 184 | const [ accountName, host ] = nameWithHost.split('@') |
201 | 185 | ||
@@ -332,7 +316,6 @@ export class AccountModel extends Model<AccountModel> { | |||
332 | 316 | ||
333 | return { | 317 | return { |
334 | id: this.id, | 318 | id: this.id, |
335 | uuid: actor.uuid, | ||
336 | name: actor.name, | 319 | name: actor.name, |
337 | displayName: this.getDisplayName(), | 320 | displayName: this.getDisplayName(), |
338 | url: actor.url, | 321 | url: actor.url, |
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 4a9acd703..e75039521 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -114,6 +114,11 @@ export class UserModel extends Model<UserModel> { | |||
114 | email: string | 114 | email: string |
115 | 115 | ||
116 | @AllowNull(true) | 116 | @AllowNull(true) |
117 | @IsEmail | ||
118 | @Column(DataType.STRING(400)) | ||
119 | pendingEmail: string | ||
120 | |||
121 | @AllowNull(true) | ||
117 | @Default(null) | 122 | @Default(null) |
118 | @Is('UserEmailVerified', value => throwIfNotValid(value, isUserEmailVerifiedValid, 'email verified boolean', true)) | 123 | @Is('UserEmailVerified', value => throwIfNotValid(value, isUserEmailVerifiedValid, 'email verified boolean', true)) |
119 | @Column | 124 | @Column |
@@ -540,6 +545,7 @@ export class UserModel extends Model<UserModel> { | |||
540 | id: this.id, | 545 | id: this.id, |
541 | username: this.username, | 546 | username: this.username, |
542 | email: this.email, | 547 | email: this.email, |
548 | pendingEmail: this.pendingEmail, | ||
543 | emailVerified: this.emailVerified, | 549 | emailVerified: this.emailVerified, |
544 | nsfwPolicy: this.nsfwPolicy, | 550 | nsfwPolicy: this.nsfwPolicy, |
545 | webTorrentEnabled: this.webTorrentEnabled, | 551 | webTorrentEnabled: this.webTorrentEnabled, |