From 755485c10204a8e0c44a1c861726f725dec0c141 Mon Sep 17 00:00:00 2001 From: Ada Werefox Date: Wed, 1 May 2024 15:21:41 -0500 Subject: [PATCH] Fixed a bug on the server's side where the access token was not being read correctly from a file and adding a newline. --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 4b6032c..2b5d0d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -399,10 +399,12 @@ pub mod info_app { #[server] async fn get_account_avatars() -> Result, 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?;