From f7b24c39292b95a0cda10573e2b9a7887b1a7a05 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sun, 28 Jun 2026 20:18:48 +0200 Subject: [PATCH] fix: re-read password hash from config in is_configured() Avoid stale in-memory hash after password reset. Load from config each time. --- src/server/services/auth_service.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/server/services/auth_service.py b/src/server/services/auth_service.py index 5a204bd..4c35594 100644 --- a/src/server/services/auth_service.py +++ b/src/server/services/auth_service.py @@ -112,7 +112,22 @@ class AuthService: return False def is_configured(self) -> bool: - return bool(self._hash) + # Always re-read from config to detect if reset happened + hash_val = None + try: + from src.server.services.config_service import get_config_service + config_service = get_config_service() + config = config_service.load_config() + hash_val = config.other.get('master_password_hash') + except Exception: + pass + + if isinstance(hash_val, str): + self._hash = hash_val + return True + # No hash in config - clear any stale in-memory hash + self._hash = None + return False def setup_master_password(self, password: str) -> str: """Set the master password (hash and store in memory/settings).