From af1f0457a1a17d28c4491e361c0c36d36007886e Mon Sep 17 00:00:00 2001 From: Alexander Oonk Date: Sat, 1 Nov 2025 15:29:17 +0100 Subject: [PATCH 1/3] Added special char to new passwords --- ui/src/components/RegisterModal.tsx | 1 + ui/src/locales/en.ts | 1 + ui/src/locales/nl.ts | 1 + ui/src/pages/admin_page/UsersAdmin.tsx | 1 + ui/src/pages/user_account_page/modals/ChangePassword.tsx | 1 + 5 files changed, 5 insertions(+) diff --git a/ui/src/components/RegisterModal.tsx b/ui/src/components/RegisterModal.tsx index 70f770f..d70b128 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..0ef4e5a 100644 --- a/ui/src/locales/en.ts +++ b/ui/src/locales/en.ts @@ -104,4 +104,5 @@ export const dict = { your_password_must_have_1_lowercase_letter: 'Your password must have 1 lowercase letter', 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', + your_password_must_have_1_special_character: 'Your password must have 1 special character', }; diff --git a/ui/src/locales/nl.ts b/ui/src/locales/nl.ts index 07391ff..eabc130 100644 --- a/ui/src/locales/nl.ts +++ b/ui/src/locales/nl.ts @@ -109,4 +109,5 @@ export const dict: Translations = { your_password_must_have_1_lowercase_letter: 'Je wachtwoord moet 1 kleine letter 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', + your_password_must_have_1_special_character: 'Je wachtwoord moet 1 speciaal teken bevatten', }; diff --git a/ui/src/pages/admin_page/UsersAdmin.tsx b/ui/src/pages/admin_page/UsersAdmin.tsx index 96da364..d443fd1 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..06ae82e 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) => ( From 1ef2f2cf859101f087507bd318387f6ba8246da1 Mon Sep 17 00:00:00 2001 From: Alexander Oonk Date: Fri, 7 Nov 2025 18:46:56 +0100 Subject: [PATCH 2/3] ran linters --- ui/src/components/RegisterModal.tsx | 2 +- ui/src/locales/en.ts | 2 +- ui/src/locales/nl.ts | 2 +- ui/src/pages/admin_page/UsersAdmin.tsx | 2 +- ui/src/pages/user_account_page/modals/ChangePassword.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/src/components/RegisterModal.tsx b/ui/src/components/RegisterModal.tsx index d70b128..1663340 100644 --- a/ui/src/components/RegisterModal.tsx +++ b/ui/src/components/RegisterModal.tsx @@ -75,7 +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')) + 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 0ef4e5a..51b8727 100644 --- a/ui/src/locales/en.ts +++ b/ui/src/locales/en.ts @@ -102,7 +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', - your_password_must_have_1_special_character: 'Your password must have 1 special character', }; diff --git a/ui/src/locales/nl.ts b/ui/src/locales/nl.ts index eabc130..de4ac00 100644 --- a/ui/src/locales/nl.ts +++ b/ui/src/locales/nl.ts @@ -107,7 +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', - your_password_must_have_1_special_character: 'Je wachtwoord moet 1 speciaal teken bevatten', }; diff --git a/ui/src/pages/admin_page/UsersAdmin.tsx b/ui/src/pages/admin_page/UsersAdmin.tsx index d443fd1..e3ebbbc 100644 --- a/ui/src/pages/admin_page/UsersAdmin.tsx +++ b/ui/src/pages/admin_page/UsersAdmin.tsx @@ -283,7 +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')) + 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 06ae82e..fecf38e 100644 --- a/ui/src/pages/user_account_page/modals/ChangePassword.tsx +++ b/ui/src/pages/user_account_page/modals/ChangePassword.tsx @@ -68,7 +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')) + pattern(/[\W]/, t('your_password_must_have_1_special_character')), ]} > {(field, props) => ( From ec75a34d691f77bfb630480d6bd4d2af6cf11cde Mon Sep 17 00:00:00 2001 From: Alexander Oonk Date: Fri, 7 Nov 2025 20:41:57 +0100 Subject: [PATCH 3/3] update cypress --- ui/cypress/e2e/admin.cy.js | 14 +++++++------- ui/cypress/e2e/authentication.cy.js | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) 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');