mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 07:48:57 +00:00
Merge pull request #127 from PR0M3TH3AN/codex/fix-login-issue-with-new-seed-profile
Fix new profile password hashing
This commit is contained in:
@@ -548,6 +548,12 @@ class PasswordManager:
|
|||||||
seed_mgr = EncryptionManager(seed_key, fingerprint_dir)
|
seed_mgr = EncryptionManager(seed_key, fingerprint_dir)
|
||||||
self.vault = Vault(self.encryption_manager, fingerprint_dir)
|
self.vault = Vault(self.encryption_manager, fingerprint_dir)
|
||||||
|
|
||||||
|
# Ensure config manager is set for the new fingerprint
|
||||||
|
self.config_manager = ConfigManager(
|
||||||
|
vault=self.vault,
|
||||||
|
fingerprint_dir=fingerprint_dir,
|
||||||
|
)
|
||||||
|
|
||||||
# Encrypt and save the parent seed
|
# Encrypt and save the parent seed
|
||||||
seed_mgr.encrypt_parent_seed(parent_seed)
|
seed_mgr.encrypt_parent_seed(parent_seed)
|
||||||
logging.info("Parent seed encrypted and saved successfully.")
|
logging.info("Parent seed encrypted and saved successfully.")
|
||||||
@@ -684,6 +690,13 @@ class PasswordManager:
|
|||||||
|
|
||||||
self.vault = Vault(self.encryption_manager, fingerprint_dir)
|
self.vault = Vault(self.encryption_manager, fingerprint_dir)
|
||||||
|
|
||||||
|
# Ensure the config manager points to the new fingerprint before
|
||||||
|
# storing the hashed password
|
||||||
|
self.config_manager = ConfigManager(
|
||||||
|
vault=self.vault,
|
||||||
|
fingerprint_dir=fingerprint_dir,
|
||||||
|
)
|
||||||
|
|
||||||
self.store_hashed_password(password)
|
self.store_hashed_password(password)
|
||||||
logging.info("User password hashed and stored successfully.")
|
logging.info("User password hashed and stored successfully.")
|
||||||
|
|
||||||
|
@@ -7,7 +7,9 @@ from typing import Callable, Dict
|
|||||||
MIGRATIONS: Dict[int, Callable[[dict], dict]] = {}
|
MIGRATIONS: Dict[int, Callable[[dict], dict]] = {}
|
||||||
|
|
||||||
|
|
||||||
def migration(from_ver: int) -> Callable[[Callable[[dict], dict]], Callable[[dict], dict]]:
|
def migration(
|
||||||
|
from_ver: int,
|
||||||
|
) -> Callable[[Callable[[dict], dict]], Callable[[dict], dict]]:
|
||||||
"""Register a migration function from *from_ver* to *from_ver* + 1."""
|
"""Register a migration function from *from_ver* to *from_ver* + 1."""
|
||||||
|
|
||||||
def decorator(func: Callable[[dict], dict]) -> Callable[[dict], dict]:
|
def decorator(func: Callable[[dict], dict]) -> Callable[[dict], dict]:
|
||||||
|
Reference in New Issue
Block a user