Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update clear auth user initiated (#2159)

Leendert de Borst9920566a4d14
diff --git a/apps/browser-extension/src/entrypoints/popup/context/AuthContext.tsx b/apps/browser-extension/src/entrypoints/popup/context/AuthContext.tsx
index aa21f2144..be548a89e 100644
--- a/apps/browser-extension/src/entrypoints/popup/context/AuthContext.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/context/AuthContext.tsx
@@ -97,12 +97,12 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
* @param errorMessage Optional error message to display on the login page
*/
const clearAuthUserInitiated = useCallback(async (errorMessage?: string) : Promise<void> => {
- // First, perform the base forced logout (clears session, vault, in-memory db, PIN)
- await clearAuthForced(errorMessage);
-
- // Additionally clear the username and local preferences, which a forced logout keeps
+ // Clear local vault data explicitly.
await sendMessage('CLEAR_VAULT_DATA');
+ // Run the parent forced logout which clears everything else.
+ await clearAuthForced(errorMessage);
+
setUsername(null);
}, [clearAuthForced]);