Fixed a bug on the server's side where the access token was not being read correctly from a file and adding a newline.

This commit is contained in:
Ada Werefox 2024-05-01 15:21:41 -05:00
parent 74f7766135
commit 755485c102
1 changed files with 3 additions and 1 deletions

View File

@ -399,10 +399,12 @@ pub mod info_app {
#[server]
async fn get_account_avatars() -> Result<Vec<Testimonial>, ServerFnError> {
let mut access_token = tokio::fs::read_to_string("access_token.key").await?;
access_token = access_token.trim().to_string();
let client = megalodon::generator(
megalodon::SNS::Mastodon,
String::from("https://yiff.life"),
Some(tokio::fs::read_to_string("access_token.key").await?),
Some(access_token),
None,
);
let testimonial_toml: String = tokio::fs::read_to_string("data/testimonials.toml").await?;