def save_temporary_user_data()

in modular_cli/service/config.py [0:0]


def save_temporary_user_data(username, data):
    cur_path = Path(__file__).parent.resolve()
    user_folder = os.path.join(cur_path, username)
    try:
        Path(user_folder).mkdir(exist_ok=True)
    except OSError:
        SYSTEM_LOG.exception(f'Creation of the directory {user_folder} failed')

    credentials_file_path = os.path.join(user_folder, TEMPORARY_CREDS_FILENAME)
    with open(credentials_file_path, 'w+') as file:
        json.dump(data, file, indent=4)