···104104 }
105105106106 pub async fn publish_blip(&mut self, content: &str) -> Result<String> {
107107- // Try the request, and if it fails with 401, refresh and retry once
107107+ // Try the request, and if it fails with auth error, refresh and retry once
108108 match self.try_publish_blip(content).await {
109109 Ok(uri) => Ok(uri),
110110 Err(e) => {
111111- // Check if this is a 401 error by examining the error message
111111+ // Check if this is an authentication error by examining the error message
112112 let error_msg = e.to_string();
113113- if error_msg.contains("401") || error_msg.contains("Unauthorized") {
113113+ if error_msg.contains("401") || error_msg.contains("Unauthorized") ||
114114+ error_msg.contains("ExpiredToken") || error_msg.contains("Token has expired") {
114115 // Try to refresh the session
115116 match self.refresh_session().await {
116117 Ok(_) => {