From 0947d1d1a6ad9804b8cc3ff05b8cb28cf03eadea Mon Sep 17 00:00:00 2001 From: KittenTM Date: Tue, 7 Apr 2026 02:10:24 +0200 Subject: [PATCH] fix(hot): correctly update fields when RememberMe is sent. note: this was originally planned so it would NOT store your data, however old codebases evolve and I had forgotten it did this, as once you click it once it will work for the rest of time. --- routes/sso.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/routes/sso.py b/routes/sso.py index 73ec5dc..e33d9cd 100644 --- a/routes/sso.py +++ b/routes/sso.py @@ -44,20 +44,19 @@ async def login( print(f"checking user {username}") user = db.query(User).filter(User.username == username).first() + enc_pass = cipher.encrypt(password.encode()).decode() + if not user: print("creating new user with argon2id") - enc_pass = cipher.encrypt(password.encode()).decode() if rememberMe else "" user = User( username=username, local_hash=auth.hash_password(password), spfn_pass_enc=enc_pass ) db.add(user) - elif rememberMe: - print("updating encrypted pass for client") - user.spfn_pass_enc = cipher.encrypt(password.encode()).decode() else: - print("client requested no password storage, skipping update") + print("updating encrypted pass for client") + user.spfn_pass_enc = enc_pass db.flush()