feat(core): Prompt user to confirm password when changing email and mfa is disabled (#19408)

Co-authored-by: Marc Littlemore <MarcL@users.noreply.github.com>
This commit is contained in:
Konstantin Tieber
2025-09-16 14:00:14 +02:00
committed by GitHub
parent ccee1acf05
commit f0388aae7e
16 changed files with 501 additions and 37 deletions

View File

@@ -236,7 +236,10 @@ describe('User Management', { disableAutoLogin: true }, () => {
INSTANCE_OWNER.email,
updatedPersonalData.newPassword,
);
personalSettingsPage.actions.updateEmail(updatedPersonalData.newEmail);
personalSettingsPage.actions.updateEmail(
updatedPersonalData.newEmail,
updatedPersonalData.newPassword,
);
successToast().should('contain', 'Personal details updated');
personalSettingsPage.actions.loginWithNewData(
updatedPersonalData.newEmail,

View File

@@ -25,6 +25,7 @@ export class PersonalSettingsPage extends BasePage {
firstNameInput: () => cy.getByTestId('firstName').find('input').first(),
lastNameInput: () => cy.getByTestId('lastName').find('input').first(),
emailInputContainer: () => cy.getByTestId('email'),
currentPasswordConfirmationInput: () => cy.getByTestId('currentPassword').find('input'),
emailInput: () => cy.getByTestId('email').find('input').first(),
changePasswordLink: () => cy.getByTestId('change-password-link').first(),
saveSettingsButton: () => cy.getByTestId('save-settings-button'),
@@ -66,8 +67,14 @@ export class PersonalSettingsPage extends BasePage {
.find('div[class^="_errorInput"]')
.should('exist');
},
updateEmail: (newEmail: string) => {
/**
* @param currentPassword only required if MFA is disabled
*/
updateEmail: (newEmail: string, currentPassword?: string) => {
this.getters.emailInput().type('{selectall}').type(newEmail).type('{enter}');
if (currentPassword) {
this.getters.currentPasswordConfirmationInput().type(currentPassword).type('{enter}');
}
},
tryToSetInvalidEmail: (newEmail: string) => {
this.actions.updateEmail(newEmail);