mirror of
https://github.com/redlib-org/redlib.git
synced 2025-04-02 04:37:35 +03:00
fix(oauth): try resetting oauth data on refresh
This commit is contained in:
parent
213481ef53
commit
a673256e80
1 changed files with 4 additions and 5 deletions
|
@ -100,11 +100,10 @@ impl Oauth {
|
|||
}
|
||||
|
||||
async fn refresh(&mut self) -> Option<()> {
|
||||
// Refresh is actually just a subsequent login with the same headers (without the old token
|
||||
// or anything). This logic is handled in login, so we just call login again.
|
||||
let refresh = self.login().await;
|
||||
info!("Refreshing OAuth token... {}", if refresh.is_some() { "success" } else { "failed" });
|
||||
refresh
|
||||
// Set self to Oauth::new()
|
||||
*self = Self::new().await;
|
||||
info!("Refreshing OAuth token... success! New token: \"{}...\"", &self.token[..32]);
|
||||
Some(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue