INNER CODE UNIT · Python

set_password

OschAI/VisioFirm · visiofirm/cli.py:46

def set_password(identifier, new_password):
    user = get_user_by_username(identifier)
    if user is None:
        user = get_user_by_email(identifier)
    if user is None:
        print(f"Error: no user found for '{identifier}' (tried username and email).",
              file=sys.stderr)
        return 1

    if update_user(user[0], {"password": new_password}):
        print(f"Password updated for '{user[1]}' ({user[5]}).")
        return 0

    print("Error: could not update password.", file=sys.stderr)
    return 1


def main(argv=None):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…