From acb0c0184aad3a8dbc6d65b222cb172d5b1e2521 Mon Sep 17 00:00:00 2001 From: zhourunlai Date: Wed, 23 Jul 2025 01:28:21 +0800 Subject: [PATCH] fix: regenerate password verification file when config_password changes --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index de85a0be..0cc54827 100644 --- a/main.py +++ b/main.py @@ -79,10 +79,10 @@ async def lifespan(app: FastAPI): Lifespan context manager for the FastAPI application. Handles startup and shutdown events. """ - # Ensure password verification file exists - if BackendAPISecurity.new_password_required(): - # Create secrets manager with CONFIG_PASSWORD - secrets_manager = ETHKeyFileSecretManger(password=settings.security.config_password) + # Ensure password verification file exists and is valid + secrets_manager = ETHKeyFileSecretManger(password=settings.security.config_password) + if BackendAPISecurity.new_password_required() \ + or not BackendAPISecurity.validate_password(secrets_manager): BackendAPISecurity.store_password_verification(secrets_manager) logging.info("Created password verification file for master_account")