Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Require authentication before changing password

Aswin Asokfcc29679c24b
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index dcd9fdc587..6859cd0b70 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -974,9 +974,10 @@ const Account: React.FC<AccountProps> = ({
onRootClose();
};
- const handleChangePassword = useCallback(() => {
+ const handleChangePassword = useCallback(async () => {
+ if (!(await onAuthenticateUser())) return;
void router.push("/change-password");
- }, [router]);
+ }, [onAuthenticateUser, router]);
const handleChangeEmail = useCallback(() => {
void router.push("/change-email");
}, [router]);
@@ -1051,7 +1052,7 @@ const Account: React.FC<AccountProps> = ({
void handlePasskeys();
break;
case "account.changePassword":
- handleChangePassword();
+ void handleChangePassword();
break;
case "account.changeEmail":
handleChangeEmail();