Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

behnaz/MARK-1062/regex-password #7176

Closed
4 changes: 1 addition & 3 deletions crowdin/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,6 @@
"1872216697": "Yes, you can choose the duration of your Asians contract anywhere between 5 and 10 ticks.",
"1872568231": "GBP/TRY",
"1872607463": "banner",
"1873174451": "Postcode is required",
"1873182175": "Apple account sign in page",
"1873188024": "A deal for 1 lot of the Volatility Index 75 for a price of USD 500,000 per USD 100,000 turnover will pay out a commission of USD 5. The minimum volume required to receive the minimum commission of USD 0.01 is determined using this formula:",
"1874424045": "I lost my phone. How can I disable two-factor authentication (2FA)?",
Expand Down Expand Up @@ -2253,7 +2252,6 @@
"2068595952": "What is derived?",
"2069255870": "Will Deriv compensate for my loss if my account falls under a scamming/phishing trap?",
"2069455291": "Date of Birth*",
"2069660515": "Postal/Zip code*",
"2070356006": "Start earning based on your chosen commission plan –– up to 45% of the total net revenue generated by your referred clients.",
"2071458958": "The minimum volume for micro forex pairs is 0.1 lot.",
"2071562301": "Singapore – Our office | Deriv",
Expand Down Expand Up @@ -4338,6 +4336,7 @@
"-136976514": "Country of residence*",
"-1474274516": "State/province*",
"-1253349870": "Town/city*",
"-490553914": "Postal/Zip code",
"-1120954663": "First name*",
"-1929304521": "Website/social media URL*",
"-1113902570": "Details",
Expand Down Expand Up @@ -4386,7 +4385,6 @@
"-173029411": "You should enter 2-20 numbers, characters.",
"-1430656728": "Password is required",
"-2092237088": "You should enter 2-10 numbers, characters.",
"-1049534775": "Please enter a valid postcode with Latin characters.",
"-1979098157": "Website url is required",
"-1857429287": "Last Name",
"-1702877392": "Important guidelines",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const AccountAddress = ({
id: 'dm-postal-code',
name: 'postal_code',
type: 'text',
label: localize('_t_Postal/Zip code*_t_'),
label: localize('_t_Postal/Zip code_t_'),
},
]

Expand All @@ -99,7 +99,6 @@ const AccountAddress = ({
form_data.state?.name &&
form_data.city &&
form_data.street &&
form_data.postal_code &&
!form_errors.country_error_msg &&
!form_errors.state_error_msg &&
!form_errors.city_error_msg &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const affiliate_validation_regex = {
value.length <= 50,
phone: (value: string) => /^\+?\d+$/.test(value),
username: (value: string) => /^[A-Za-z0-9_]{3,20}$/.test(value),
password: (value: string) => /^(?=.*[a-z])(?=.*[0-9])(?=.*[A-Z])[ -~]{6,50}$/.test(value),
password: (value: string) =>
/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?!.*\W)(?!.* ).{8,50}$/.test(value),
city: (value: string) =>
/^[\p{L}][\p{L}\s'.-]{0,49}$/u.test(value) &&
value.trim().length >= 2 &&
Expand Down Expand Up @@ -95,27 +96,16 @@ const phoneValidation = (input: string) => {
}
const passwordValidation = (input: string) => {
if (!input) return localize('_t_Password is required_t_')
else if (input.length < 8 || input.length > 50) {
else if (input.length < 8 || input.length > 50)
return localize('_t_You should enter 8-50 characters._t_')
} else if (
!affiliate_validation_regex.password(input) ||
!affiliate_validation_regex.non_empty_string(input)
) {
else if (!affiliate_validation_regex.password(input))
return localize(
'_t_Password should have lower and uppercase English letters with numbers._t_',
)
}
}
const postcodeValidation = (input: string) => {
if (!input) return localize('_t_Postcode is required_t_')
else if (input.length < 2 || input.length > 10) {
if (!affiliate_validation_regex.postal_code(input))
return localize('_t_You should enter 2-10 numbers, characters._t_')
} else if (
!affiliate_validation_regex.postal_code(input) ||
!affiliate_validation_regex.non_empty_string(input)
) {
return localize('_t_Please enter a valid postcode with Latin characters._t_')
}
}
const streetValidation = (input: string) => {
if (!input) return localize('_t_Street is required_t_')
Expand Down
Loading
Loading