mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
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:
committed by
GitHub
parent
ccee1acf05
commit
f0388aae7e
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user