from werkzeug.security import check_password_hash def verify_password(user, password): return bool(user) and check_password_hash(user["password_hash"], password or "")