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