Update test
This commit is contained in:
parent
7224fada5d
commit
7fc623dbe5
1 changed files with 15 additions and 12 deletions
27
src/lib.rs
27
src/lib.rs
|
@ -344,19 +344,22 @@ impl Client {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn login_api(&mut self) -> Result<String> {
|
pub async fn login_api(&mut self) -> Result<String> {
|
||||||
let jwt = reqwest::Client::new()
|
dbg!(self.session.as_ref().context("Not logged in")?);
|
||||||
.get(self.api_url.join("token/new")?)
|
// let jwt = reqwest::Client::new()
|
||||||
.header(
|
// .get(self.api_url.join("token/new")?)
|
||||||
reqwest::header::COOKIE,
|
// .header(
|
||||||
self.session.as_ref().context("Not logged in")?,
|
// reqwest::header::COOKIE,
|
||||||
)
|
// self.session.as_ref().context("Not logged in")?,
|
||||||
.send()
|
// )
|
||||||
.await?
|
// .send()
|
||||||
.text()
|
// .await?
|
||||||
.await?;
|
// .text()
|
||||||
self.authorization = Some(jwt.to_string());
|
// .await?;
|
||||||
|
// self.authorization = Some(jwt.to_string());
|
||||||
|
|
||||||
Ok(jwt)
|
// Ok(jwt)
|
||||||
|
|
||||||
|
bail!("ddd");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn login(&mut self) -> Result<()> {
|
pub async fn login(&mut self) -> Result<()> {
|
||||||
|
|
Loading…
Reference in a new issue