mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-25 16:09:42 +01:00
web: create backup on submit when changing password
This commit is contained in:
committed by
Abdullah Atta
parent
b526dc4d39
commit
ea0623c6bc
@@ -45,7 +45,6 @@ export const AuthenticationSettings: SettingsGroup[] = [
|
||||
title: strings.changePassword(),
|
||||
variant: "secondary",
|
||||
action: async () => {
|
||||
if (!(await createBackup())) return;
|
||||
const result = await showPasswordDialog({
|
||||
title: strings.changePassword(),
|
||||
message: strings.changePasswordDesc(),
|
||||
@@ -60,6 +59,7 @@ export const AuthenticationSettings: SettingsGroup[] = [
|
||||
}
|
||||
},
|
||||
validate: async ({ oldPassword, newPassword }) => {
|
||||
if (!(await createBackup())) return false;
|
||||
await db.user.clearSessions();
|
||||
return (
|
||||
(await db.user.changePassword(oldPassword, newPassword)) ||
|
||||
|
||||
Reference in New Issue
Block a user