diff --git a/ui/cypress/e2e/admin.cy.js b/ui/cypress/e2e/admin.cy.js index bfb1e88..e4f4a46 100644 --- a/ui/cypress/e2e/admin.cy.js +++ b/ui/cypress/e2e/admin.cy.js @@ -27,7 +27,7 @@ describe('admin', () => { cy.get('#email').clear('te'); cy.get('#email').type('test@test.nl'); cy.get('#password').clear(); - cy.get('#password').type('Testing1'); + cy.get('#password').type('Testing1!'); cy.get('.modal-action > .btn').click(); cy.wait(100); @@ -42,7 +42,7 @@ describe('admin', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input').click(); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('test@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1!'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.wait(50); @@ -64,7 +64,7 @@ describe('admin', () => { cy.get('#email').clear('ad'); cy.get('#email').type('admin2@test.nl'); cy.get('#password').clear(); - cy.get('#password').type('Testing1'); + cy.get('#password').type('Testing1@'); cy.get('.checkbox').check(); cy.get('.modal-action > .btn').click(); cy.get('.text').click(); @@ -72,7 +72,7 @@ describe('admin', () => { cy.get('.hidden > :nth-child(1)').click(); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('admin2@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1@'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.get('.text').click(); cy.get(':nth-child(2) > .btn > .fa-solid').click(); @@ -94,7 +94,7 @@ describe('admin', () => { cy.get('#email').clear('te'); cy.get('#email').type('test@test.nl'); cy.get('#password').clear(); - cy.get('#password').type('Testing1'); + cy.get('#password').type('Testing1!'); cy.get('.modal-action > .btn').click(); cy.get('.text').click(); cy.get('.menu > :nth-child(3) > .btn').click(); @@ -102,7 +102,7 @@ describe('admin', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').clear('te'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('test@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1!'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.get('.text').click(); cy.get('[open=""] > .menu > :nth-child(2) > .btn').click(); @@ -122,7 +122,7 @@ describe('admin', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').clear('te'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('test@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1!'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.get('.alert span').should('contain.text', 'Could not login with the given email and password'); diff --git a/ui/cypress/e2e/authentication.cy.js b/ui/cypress/e2e/authentication.cy.js index 1c629b8..c894020 100644 --- a/ui/cypress/e2e/authentication.cy.js +++ b/ui/cypress/e2e/authentication.cy.js @@ -23,9 +23,9 @@ describe('authentication', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').clear('b'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('test@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1!'); cy.get('#checkPassword').clear(); - cy.get('#checkPassword').type('Testing1'); + cy.get('#checkPassword').type('Testing1!'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.url().should('include', '/home') @@ -76,9 +76,9 @@ describe('authentication', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').clear('ad'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('admin@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1!'); cy.get('#checkPassword').clear(); - cy.get('#checkPassword').type('Testing1{enter}'); + cy.get('#checkPassword').type('Testing1!{enter}'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.get('.alert span').should('contain.text', 'An account with this email already exists'); @@ -102,9 +102,9 @@ describe('authentication', () => { cy.get('#currentPassword').clear('ad'); cy.get('#currentPassword').type('admin'); cy.get('#newPassword').clear(); - cy.get('#newPassword').type('Testing1'); + cy.get('#newPassword').type('Testing1@'); cy.get('#confirmNewPassword').clear(); - cy.get('#confirmNewPassword').type('Testing1{enter}'); + cy.get('#confirmNewPassword').type('Testing1@{enter}'); cy.get('.text').click(); cy.get('.menu > :nth-child(3) > .btn').click(); @@ -113,7 +113,7 @@ describe('authentication', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').clear('ad'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('admin@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1@'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.url().should('include', '/home') @@ -125,9 +125,9 @@ describe('authentication', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').clear('te'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('test@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1!'); cy.get('#checkPassword').clear(); - cy.get('#checkPassword').type('Testing1'); + cy.get('#checkPassword').type('Testing1!'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.url().should('include', '/home') @@ -140,7 +140,7 @@ describe('authentication', () => { cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').clear('te'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(1) > .input > #email').type('test@test.nl'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').clear(); - cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1{enter}'); + cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > :nth-child(2) > .input > #password').type('Testing1!{enter}'); cy.get('.modal-open > .modal-box > form.w-full > .space-y-4 > .modal-action > .btn').click(); cy.get('.alert span').should('contain.text', 'Could not login with the given email and password'); diff --git a/ui/src/components/RegisterModal.tsx b/ui/src/components/RegisterModal.tsx index 70f770f..1663340 100644 --- a/ui/src/components/RegisterModal.tsx +++ b/ui/src/components/RegisterModal.tsx @@ -75,6 +75,7 @@ export function RegisterModal(props: ModalBaseProps): JSXElement { pattern(/[A-Z]/, t('your_password_must_have_1_uppercase_letter')), pattern(/[a-z]/, t('your_password_must_have_1_lowercase_letter')), pattern(/[0-9]/, t('your_password_must_have_1_digit')), + pattern(/[\W]/, t('your_password_must_have_1_special_character')), ]} > {(field, props) => ( diff --git a/ui/src/locales/en.ts b/ui/src/locales/en.ts index 1e89ae6..51b8727 100644 --- a/ui/src/locales/en.ts +++ b/ui/src/locales/en.ts @@ -102,6 +102,7 @@ export const dict = { your_email_is_not_verified_yet: 'Your email is not verified yet', your_password_must_have_1_digit: 'Your password must have 1 digit', your_password_must_have_1_lowercase_letter: 'Your password must have 1 lowercase letter', + your_password_must_have_1_special_character: 'Your password must have 1 special character', your_password_must_have_1_uppercase_letter: 'Your password must have 1 uppercase letter', your_password_must_have_8_characters_or_more: 'Your password must have 8 characters or more', }; diff --git a/ui/src/locales/nl.ts b/ui/src/locales/nl.ts index 07391ff..de4ac00 100644 --- a/ui/src/locales/nl.ts +++ b/ui/src/locales/nl.ts @@ -107,6 +107,7 @@ export const dict: Translations = { your_email_is_not_verified_yet: 'Je e-mail is nog niet geverifieerd', your_password_must_have_1_digit: 'Je wachtwoord moet 1 cijfer bevatten', your_password_must_have_1_lowercase_letter: 'Je wachtwoord moet 1 kleine letter bevatten', + your_password_must_have_1_special_character: 'Je wachtwoord moet 1 speciaal teken bevatten', your_password_must_have_1_uppercase_letter: 'Je wachtwoord moet 1 hoofdletter bevatten', your_password_must_have_8_characters_or_more: 'Je wachtwoord moet 8 tekens of meer bevatten', }; diff --git a/ui/src/pages/admin_page/UsersAdmin.tsx b/ui/src/pages/admin_page/UsersAdmin.tsx index 96da364..e3ebbbc 100644 --- a/ui/src/pages/admin_page/UsersAdmin.tsx +++ b/ui/src/pages/admin_page/UsersAdmin.tsx @@ -283,6 +283,7 @@ function CreateUserModal(props: CreateUserModalProps): JSXElement { pattern(/[A-Z]/, t('your_password_must_have_1_uppercase_letter')), pattern(/[a-z]/, t('your_password_must_have_1_lowercase_letter')), pattern(/[0-9]/, t('your_password_must_have_1_digit')), + pattern(/[\W]/, t('your_password_must_have_1_special_character')), ]} > {(field, props) => ( diff --git a/ui/src/pages/user_account_page/modals/ChangePassword.tsx b/ui/src/pages/user_account_page/modals/ChangePassword.tsx index 8bf2f11..fecf38e 100644 --- a/ui/src/pages/user_account_page/modals/ChangePassword.tsx +++ b/ui/src/pages/user_account_page/modals/ChangePassword.tsx @@ -68,6 +68,7 @@ export function ChangePasswordModal(props: ModalBaseProps): JSXElement { pattern(/[A-Z]/, t('your_password_must_have_1_uppercase_letter')), pattern(/[a-z]/, t('your_password_must_have_1_lowercase_letter')), pattern(/[0-9]/, t('your_password_must_have_1_digit')), + pattern(/[\W]/, t('your_password_must_have_1_special_character')), ]} > {(field, props) => (