feat: proxy password validation
This commit is contained in:
@@ -54,6 +54,13 @@ User.init(
|
|||||||
proxy_username: {
|
proxy_username: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
|
validate: {
|
||||||
|
isProxyPasswordRequired(value: string | null) {
|
||||||
|
if (value && !this.proxy_password) {
|
||||||
|
throw new Error('Proxy password is required when proxy username is provided');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
proxy_password: {
|
proxy_password: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
|
|||||||
Reference in New Issue
Block a user