feat: add server list page
This commit is contained in:
@@ -19,14 +19,15 @@ pub async fn get_access_token() -> Result<String, Box<dyn Error>> {
|
||||
let pool = db::get_pool().await?;
|
||||
let tok = query!("SELECT * FROM tokens WHERE is_refresh = 0 ORDER BY expires_at DESC LIMIT 1")
|
||||
.fetch_one(&pool)
|
||||
.await?
|
||||
.token;
|
||||
.await?;
|
||||
|
||||
Ok(tok)
|
||||
dbg!(&tok);
|
||||
Ok(tok.token)
|
||||
}
|
||||
|
||||
pub async fn get_authed_api_config() -> Result<configuration::Configuration, Box<dyn Error>> {
|
||||
let mut conf = configuration::Configuration::default();
|
||||
conf.bearer_access_token = Some(get_access_token().await?);
|
||||
|
||||
Ok(conf)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user