aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/api/users.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/api/users.py')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/api/users.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/api/users.py b/packages/meshbay-hub/src/meshbay_hub/api/users.py
index 991a4f7..7b2fc8c 100644
--- a/packages/meshbay-hub/src/meshbay_hub/api/users.py
+++ b/packages/meshbay-hub/src/meshbay_hub/api/users.py
@@ -222,8 +222,8 @@ async def register(
if not credential:
raise HTTPException(status_code=400, detail="auth_key or password required")
- pw_hash, pw_salt = await hash_password_off_loop(credential)
pw_ver = current_pw_version() if body.auth_key else 2
+ pw_hash, pw_salt = await hash_password_off_loop(credential, pw_ver)
hub_id = _cfg.identity.id if _cfg else "meshbay.org"
user = User(
username=body.username,
@@ -399,7 +399,7 @@ async def login(
user.pw_version = current_pw_version()
elif user.pw_version < 2:
# Legacy rehash: upgrade Argon2 params within the password scheme (v1 -> v2)
- new_hash, new_salt = await hash_password_off_loop(body.password)
+ new_hash, new_salt = await hash_password_off_loop(body.password, 2)
user.pw_hash = new_hash
user.pw_salt = new_salt
user.pw_version = 2