π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[web][photos] Discard stale Export authentication results
Aswin Asok09357fb5eb9e
diff --git a/web/apps/photos/src/components/sidebar/Sidebar.tsx b/web/apps/photos/src/components/sidebar/Sidebar.tsxindex 5f1b694d66..c0785c7d81 100644--- a/web/apps/photos/src/components/sidebar/Sidebar.tsx+++ b/web/apps/photos/src/components/sidebar/Sidebar.tsx@@ -117,9 +117,14 @@ export const Sidebar: React.FC<SidebarProps> = ({const { show: showExport, props: exportVisibilityProps } =useModalVisibility();const { onClose: closeExport } = exportVisibilityProps;+ const exportAuthGeneration = useRef(0);useEffect(() => {if (!open) closeExport();+ return () => {+ // Discard authentication results after Sidebar closes or unmounts.+ exportAuthGeneration.current += 1;+ };}, [open, closeExport]);const { watchFolderView, setWatchFolderView } = usePhotosAppContext();@@ -163,9 +168,11 @@ export const Sidebar: React.FC<SidebarProps> = ({return;}+ const authGeneration = exportAuthGeneration.current;void (async () => {try {if (!(await onAuthenticateUser())) return;+ if (authGeneration !== exportAuthGeneration.current) return;showExport();} catch (error) {log.error("Failed to authenticate before export", error);