fix(auth): handle unparseable stored password hash gracefully in authenticate_user (#29092)

This commit is contained in:
teddiesloco 2026-08-27 18:53:20 +07:00
parent d3e8bf3405
commit 9f2df770c1

View file

@ -157,9 +157,16 @@ class AuthsTable:
async with get_async_db_context(db) as session:
credential = await session.get(Auth, resolved.id)
if not credential or not credential.active:
await verify_password(PLACEHOLDER_HASH)
try:
await verify_password(PLACEHOLDER_HASH)
except Exception:
pass
return
if not await verify_password(credential.password):
try:
if not await verify_password(credential.password):
return
except Exception:
log.warning('Unparseable stored password hash for user: %s', email)
return
return resolved