feat: proxy password validation

This commit is contained in:
karishmas6
2024-10-02 22:39:09 +05:30
parent 11d5b2f2ba
commit c379b84942

View File

@@ -54,6 +54,13 @@ User.init(
proxy_username: {
type: DataTypes.STRING,
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: {
type: DataTypes.STRING,