diff --git a/src/connection/user.rs b/src/connection/user.rs index b9f5b15..f8ac59e 100644 --- a/src/connection/user.rs +++ b/src/connection/user.rs @@ -1,6 +1,7 @@ use anyhow::Error; use serde_json::Value; +use crate::model::authenticated::AuthenticatedUser; use crate::{ messages::user::{ UserBioRequest, UserDisplayImageRequest, UserDisplayNameRequest, UserRepositoriesRequest, @@ -78,11 +79,13 @@ async fn bio( async fn repositories( Message(request): Message, State(connection_state): State, + requesting_user: Option, ) -> Result<(), UserError> { - let mut repository_backend = connection_state.repository_backend.lock().await; + let requesting_user = requesting_user.map(|u| u.0); + let mut repository_backend = connection_state.repository_backend.lock().await; let repositories = repository_backend - .repositories_for_user(&request.user) + .repositories_for_user(requesting_user.as_ref(), &request.user) .await; let repositories = match repositories {