// SPDX-FileCopyrightText: 2022 Matteo Settenvini // SPDX-License-Identifier: AGPL-3.0-or-later use {crate::config::Config, anyhow::Result, reqwest::Url}; pub async fn with(configuration: &mut Config, server: &str) -> Result<()> { tokio::task::block_in_place(move || -> anyhow::Result<()> { configuration .credentials .add(Url::parse(server)?) .expect("Unable to authenticate to NextCloud instance"); Ok(()) }) }