mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Only prompt for MFA code when email is updated (#15065)
This commit is contained in:
@@ -151,24 +151,25 @@ async function saveUserSettings(params: UserBasicDetailsWithMfa) {
|
||||
}
|
||||
|
||||
async function onSubmit(form: UserBasicDetailsForm) {
|
||||
if (!usersStore.currentUser?.mfaEnabled) {
|
||||
await saveUserSettings(form);
|
||||
return;
|
||||
}
|
||||
const emailChanged = usersStore.currentUser?.email !== form.email;
|
||||
|
||||
uiStore.openModal(PROMPT_MFA_CODE_MODAL_KEY);
|
||||
if (usersStore.currentUser?.mfaEnabled && emailChanged) {
|
||||
uiStore.openModal(PROMPT_MFA_CODE_MODAL_KEY);
|
||||
|
||||
promptMfaCodeBus.once('closed', async (payload: MfaModalEvents['closed']) => {
|
||||
if (!payload) {
|
||||
// User closed the modal without submitting the form
|
||||
return;
|
||||
}
|
||||
promptMfaCodeBus.once('closed', async (payload: MfaModalEvents['closed']) => {
|
||||
if (!payload) {
|
||||
// User closed the modal without submitting the form
|
||||
return;
|
||||
}
|
||||
|
||||
await saveUserSettings({
|
||||
...form,
|
||||
mfaCode: payload.mfaCode,
|
||||
await saveUserSettings({
|
||||
...form,
|
||||
mfaCode: payload.mfaCode,
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
await saveUserSettings(form);
|
||||
}
|
||||
}
|
||||
|
||||
async function updateUserBasicInfo(userBasicInfo: UserBasicDetailsWithMfa) {
|
||||
|
||||
Reference in New Issue
Block a user