diff --git a/server/src/core/user/tests/validator.test.ts b/server/src/core/user/tests/validator.test.ts index 8e57bb09..2354c729 100644 --- a/server/src/core/user/tests/validator.test.ts +++ b/server/src/core/user/tests/validator.test.ts @@ -18,16 +18,11 @@ describe('validatesCreate', () => { testValidationFails(validators.validatesCreate, [ { phone: '25472929109', password: 'dsksjjn,' }, { phone: '25472929109', password: 'dsksjjn,', name: ''}, - { phone: '+254729291091', password: 'dsks12jnDM4' }, - { phone: '2548292910919', password: 'dsks12jnDM4SEZLZSS' }, - { phone: '254738103012', password: 'f' }, { phone: '254738103012', password: 'wiedna102Ldnffrfldm' }, { phone: '', password: 'wiedna102Ldnffrfldm' }, - { phone: '254738103012', password: '' }, { password: 'wiedna102Ldnffrfldm' }, { phone: '254738103012' }, { phone: '254738103012', password: 1 }, - { phone: '254729291091', password: 'dsks12jnDM4SEZLZSS', googleIdToken: 'dsks12jnDM4SEZLZSS' }, { phone: '254729291091', password: '', googleIdToken: 'dsks12jnDM4SEZLZSS' }, { phone: '254729291091', password: 'dsks12jnDM4SEZLZSS', googleIdToken: '' }, { phone: '', googleIdToken: 'dsks12jnDM4SEZLZSS' }, @@ -41,9 +36,13 @@ describe('validatesLogin', () => { it('should not throw error if inputs are valid', () => { testValidationSucceeds(validators.validatesLogin, [ { phone: '254729291091', password: 'dsksjjn,' }, + { phone: '254738103012', password: 'f' }, { phone: '254729291091', password: 'dsks12jnDM4' }, { phone: '254729291091', password: 'dsks12jnDM4SEZLZSS' }, { phone: '254729291091', googleIdToken: 'dsks12jnDM4SEZLZSS' }, + { phone: '254829291091', password: 'dsks12jnDM4SEZLZSS' }, + { phone: '254129291091', password: 'dsks12jnDM4SEZLZSS' }, + { phone: '254738103012', password: 'wiedna102Ldnffrfldm' }, { googleIdToken: 'dsks12jnDM4SEZLZSS' } ]); }); @@ -51,10 +50,6 @@ describe('validatesLogin', () => { testValidationFails(validators.validatesLogin, [ { phone: '25472929109', password: 'dsksjjn,' }, { phone: '+254729291091', password: 'dsks12jnDM4' }, - { phone: '2548292910916', password: 'dsks12jnDM4SEZLZSS' }, - { phone: '254738103012', password: 'f' }, - { phone: '254738103012', password: 'wiedna102Ldnffrfldm' }, - { phone: '254729291091', password: 'dsks12jnDM4SEZLZSS', googleIdToken: 'dsks12jnDM4SEZLZSS' }, { phone: '', password: '', googleIdToken: 'dsks12jnDM4SEZLZSS' }, { phone: '254729291091', password: 'dsks12jnDM4SEZLZSS', googleIdToken: '' }, { phone: '', googleIdToken: 'dsks12jnDM4SEZLZSS' }, diff --git a/server/src/core/util/validation-util.ts b/server/src/core/util/validation-util.ts index 02e5bfd7..8a2cdf45 100644 --- a/server/src/core/util/validation-util.ts +++ b/server/src/core/util/validation-util.ts @@ -22,7 +22,7 @@ export const validateId = makeValidatorFromJoiSchema(idValidationSchema); export const phoneValidationSchema = joi.string() .required() - .pattern(/^254\d{9}$/) // Starts with 254 and ends with 8 digits + .pattern(/^254\d{9}$/) // Starts with 254 and ends with 9 digits .messages({ 'any.required': 'Phone is required', 'string.base': 'Invalid type, phone must be a string', @@ -32,7 +32,6 @@ export const phoneValidationSchema = joi.string() export const passwordValidationSchema = joi.string() .required() - .pattern(/^.{8,18}$/) .messages({ 'any.required': 'Password is required', 'string.base': 'Invalid type, password must be a string', diff --git a/server/yarn.lock b/server/yarn.lock index fcade4d0..37a5ce6f 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -1146,9 +1146,9 @@ bignumber.js@^7.0.0: integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== bl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.0.tgz#e1a574cdf528e4053019bb800b041c0ac88da493" - integrity sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA== + version "2.2.1" + resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.1.tgz#8c11a7b730655c5d56898cdc871224f40fd901d5" + integrity sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g== dependencies: readable-stream "^2.3.5" safe-buffer "^5.1.1" @@ -4320,9 +4320,9 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" - integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== safe-regex@^1.1.0: version "1.1.0" diff --git a/webapp/public/index.html b/webapp/public/index.html index 0295b0f6..95c1e88e 100644 --- a/webapp/public/index.html +++ b/webapp/public/index.html @@ -16,15 +16,15 @@ diff --git a/webapp/src/components/donate-modal.vue b/webapp/src/components/donate-modal.vue index 7167ee10..5f5aa913 100644 --- a/webapp/src/components/donate-modal.vue +++ b/webapp/src/components/donate-modal.vue @@ -20,14 +20,14 @@ - {{ validationMessages[1] }} + {{ validationMessages.amount }}
A transaction fee may be charged by the provider @@ -42,8 +42,8 @@