def login_uname_pwd(server, api_key=None):
    """
    Prompts user for username and password, gets API key from server
    if not provided.
    """
    username = click.prompt("Please enter your One Codex (email)")
    if api_key is not None:
        return username, api_key

    password = click.prompt("Please enter your password (typing will be hidden)", hide_input=True)

    # now get the API key
    api_key = fetch_api_key_from_uname(username, password, server)
    return username, api_key
Prompts user for username and password, gets API key from server
    if not provided.