Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update logout to clear all local settings in browser extension (#1694)
Leendert de Borsta102548bc071
diff --git a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.tsindex 1157b3306..3c572e096 100644--- a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts+++ b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts@@ -5,6 +5,7 @@ import type { EncryptionKeyDerivationParams } from '@/utils/dist/core/models/metimport type { Item } from '@/utils/dist/core/models/vault';import type { Vault, VaultResponse, VaultPostResponse } from '@/utils/dist/core/models/webapi';import { EncryptionUtility } from '@/utils/EncryptionUtility';+import { LocalPreferencesService } from '@/utils/LocalPreferencesService';import { SqliteClient } from '@/utils/SqliteClient';import { getItemWithFallback } from '@/utils/StorageUtility';import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';@@ -288,7 +289,7 @@ export async function handleClearSession(): Promise<messageBoolResponse> {/*** Clear vault data and username.- * This removes all persistent vault storage.+ * This removes all persistent vault storage and local preferences.*/export async function handleClearVaultData(): Promise<messageBoolResponse> {// Clear vault data@@ -305,6 +306,9 @@ export async function handleClearVaultData(): Promise<messageBoolResponse> {'local:username',]);+ // Clear all local preferences (site settings, login save settings, etc.)+ await LocalPreferencesService.clearAll();+return { success: true };}diff --git a/apps/browser-extension/src/utils/LocalPreferencesService.ts b/apps/browser-extension/src/utils/LocalPreferencesService.tsindex cd73bac01..bc3a18959 100644--- a/apps/browser-extension/src/utils/LocalPreferencesService.ts+++ b/apps/browser-extension/src/utils/LocalPreferencesService.ts@@ -310,21 +310,12 @@ export const LocalPreferencesService = {/*** Clear all preferences. Called on logout to reset everything.+ * Clears all keys managed by this service.*/async clearAll(): Promise<void> {- await Promise.all([- storage.removeItem(KEYS.SHOW_FOLDERS),- storage.removeItem(KEYS.DISABLED_SITES),- storage.removeItem(KEYS.TEMPORARY_DISABLED_SITES),- storage.removeItem(KEYS.PASSKEY_DISABLED_SITES),- storage.removeItem(KEYS.VAULT_LOCKED_DISMISS_UNTIL),- storage.removeItem(KEYS.CUSTOM_EMAIL_HISTORY),- storage.removeItem(KEYS.CUSTOM_USERNAME_HISTORY),- /*- * Note: We don't clear global settings like autofill enabled, clipboard timeout, etc.- * as those are user preferences that should persist across logins.- */- ]);+ await Promise.all(+ Object.values(KEYS).map(key => storage.removeItem(key))+ );},/**diff --git a/apps/server/AliasVault.Client/wwwroot/css/tailwind.css b/apps/server/AliasVault.Client/wwwroot/css/tailwind.cssindex 13fc8a53c..d396f891f 100644--- a/apps/server/AliasVault.Client/wwwroot/css/tailwind.css+++ b/apps/server/AliasVault.Client/wwwroot/css/tailwind.css@@ -1113,10 +1113,6 @@ video {min-height: 100vh;}-.min-h-\[250px\] {- min-height: 250px;-}-.w-1 {width: 0.25rem;}@@ -2007,11 +2003,6 @@ video {background-color: rgb(234 179 8 / var(--tw-bg-opacity));}-.bg-blue-700 {- --tw-bg-opacity: 1;- background-color: rgb(29 78 216 / var(--tw-bg-opacity));-}-.bg-opacity-50 {--tw-bg-opacity: 0.5;}@@ -2235,10 +2226,6 @@ video {padding-top: 2rem;}-.pt-2 {- padding-top: 0.5rem;-}-.text-left {text-align: left;}@@ -2895,11 +2882,6 @@ video {background-color: rgb(153 27 27 / var(--tw-bg-opacity));}-.hover\:bg-blue-800:hover {- --tw-bg-opacity: 1;- background-color: rgb(30 64 175 / var(--tw-bg-opacity));-}-.hover\:from-primary-600:hover {--tw-gradient-from: #d68338 var(--tw-gradient-from-position);--tw-gradient-to: rgb(214 131 56 / 0) var(--tw-gradient-to-position);@@ -3005,16 +2987,6 @@ video {color: rgb(255 255 255 / var(--tw-text-opacity));}-.hover\:text-blue-700:hover {- --tw-text-opacity: 1;- color: rgb(29 78 216 / var(--tw-text-opacity));-}--.hover\:text-blue-800:hover {- --tw-text-opacity: 1;- color: rgb(30 64 175 / var(--tw-text-opacity));-}-.hover\:underline:hover {text-decoration-line: underline;}@@ -3770,16 +3742,6 @@ video {background-color: rgb(127 29 29 / 0.5);}-.dark\:hover\:bg-blue-600:hover:is(.dark *) {- --tw-bg-opacity: 1;- background-color: rgb(37 99 235 / var(--tw-bg-opacity));-}--.dark\:hover\:bg-blue-700:hover:is(.dark *) {- --tw-bg-opacity: 1;- background-color: rgb(29 78 216 / var(--tw-bg-opacity));-}-.dark\:hover\:from-primary-500:hover:is(.dark *) {--tw-gradient-from: #f49541 var(--tw-gradient-from-position);--tw-gradient-to: rgb(244 149 65 / 0) var(--tw-gradient-to-position);@@ -3855,16 +3817,6 @@ video {color: rgb(255 255 255 / var(--tw-text-opacity));}-.dark\:hover\:text-blue-200:hover:is(.dark *) {- --tw-text-opacity: 1;- color: rgb(191 219 254 / var(--tw-text-opacity));-}--.dark\:hover\:text-blue-400:hover:is(.dark *) {- --tw-text-opacity: 1;- color: rgb(96 165 250 / var(--tw-text-opacity));-}-.dark\:hover\:file\:bg-primary-800\/60:is(.dark *)::file-selector-button:hover {background-color: rgb(154 93 38 / 0.6);}