diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/user.ts | 4 | ||||
-rw-r--r-- | server/models/oauth/oauth-token.ts | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index d0d9a0508..1bff955df 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -222,7 +222,7 @@ enum ScopeNames { | |||
222 | export class UserModel extends Model<UserModel> { | 222 | export class UserModel extends Model<UserModel> { |
223 | 223 | ||
224 | @AllowNull(true) | 224 | @AllowNull(true) |
225 | @Is('UserPassword', value => throwIfNotValid(value, isUserPasswordValid, 'user password')) | 225 | @Is('UserPassword', value => throwIfNotValid(value, isUserPasswordValid, 'user password', true)) |
226 | @Column | 226 | @Column |
227 | password: string | 227 | password: string |
228 | 228 | ||
@@ -388,7 +388,7 @@ export class UserModel extends Model<UserModel> { | |||
388 | @BeforeCreate | 388 | @BeforeCreate |
389 | @BeforeUpdate | 389 | @BeforeUpdate |
390 | static cryptPasswordIfNeeded (instance: UserModel) { | 390 | static cryptPasswordIfNeeded (instance: UserModel) { |
391 | if (instance.changed('password')) { | 391 | if (instance.changed('password') && instance.password) { |
392 | return cryptPassword(instance.password) | 392 | return cryptPassword(instance.password) |
393 | .then(hash => { | 393 | .then(hash => { |
394 | instance.password = hash | 394 | instance.password = hash |
diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts index d2101ce86..e73c4be7d 100644 --- a/server/models/oauth/oauth-token.ts +++ b/server/models/oauth/oauth-token.ts | |||
@@ -97,6 +97,9 @@ export class OAuthTokenModel extends Model<OAuthTokenModel> { | |||
97 | @Column | 97 | @Column |
98 | refreshTokenExpiresAt: Date | 98 | refreshTokenExpiresAt: Date |
99 | 99 | ||
100 | @Column | ||
101 | authName: string | ||
102 | |||
100 | @CreatedAt | 103 | @CreatedAt |
101 | createdAt: Date | 104 | createdAt: Date |
102 | 105 | ||