From f1b9eb9e54bc264c235a4d77a18ad2f3c943a6d1 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 24 Sep 2022 17:35:55 +0200 Subject: Do not check auth for get_user --- src/routes/user.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/routes/user.rs') diff --git a/src/routes/user.rs b/src/routes/user.rs index 791e441..4904531 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -101,8 +101,8 @@ async fn delete_my_avatar(claims: Claims) -> Result, AppError> { Ok(Json(user)) } -/// Get an user with id = `user_id`. Checks Authorization token -async fn get_user(Path(user_id): Path, _: Claims) -> Result, AppError> { +/// Get an user with id = `user_id` +async fn get_user(Path(user_id): Path) -> Result, AppError> { match User::find_by_id(user_id).await { Ok(user) => Ok(Json(user)), Err(_) => Err(AppError::NotFound("User not found".to_string())), -- cgit v1.2.3-71-g8e6c