Skip to content

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

Refactor (#1338)

Leendert de Borstbdc405a83609
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx b/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
index ad772d4c4..405e20662 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/settings/VaultUnlockSettings.tsx
@@ -9,7 +9,7 @@ import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
import {
isPinEnabled,
setupPin,
- disablePin,
+ removeAndDisablePin,
isValidPin,
isPinLocked,
InvalidPinFormatError
@@ -153,7 +153,7 @@ const VaultUnlockSettings: React.FC = () => {
try {
showLoading();
- await disablePin();
+ await removeAndDisablePin();
setPinEnabled(false);
setIsLocked(false);
hideLoading();
diff --git a/apps/browser-extension/src/utils/PinUnlockService.ts b/apps/browser-extension/src/utils/PinUnlockService.ts
index be7589bca..1accf811d 100644
--- a/apps/browser-extension/src/utils/PinUnlockService.ts
+++ b/apps/browser-extension/src/utils/PinUnlockService.ts
@@ -272,7 +272,7 @@ export async function unlockWithPin(pin: string): Promise<string> {
* This prevents offline brute-force attacks on the encrypted key.
*/
if (newAttempts >= MAX_PIN_ATTEMPTS) {
- await disablePin();
+ await removeAndDisablePin();
throw new PinLockedError();
}
@@ -281,9 +281,9 @@ export async function unlockWithPin(pin: string): Promise<string> {
}
/**
- * Disable PIN unlock and clear all stored data
+ * Disable PIN unlock and remove all stored (encrypted) data.
*/
-export async function disablePin(): Promise<void> {
+export async function removeAndDisablePin(): Promise<void> {
try {
await Promise.all([
storage.removeItem(PIN_ENABLED_KEY),