summaryrefslogtreecommitdiffstats
path: root/src/routes/user.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-24 15:35:55 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-09-24 15:35:55 +0000
commitf1b9eb9e54bc264c235a4d77a18ad2f3c943a6d1 (patch)
treebca91d30534129cdb8e5455d487cc1a4c8811573 /src/routes/user.rs
parent98afa8460939c8df3c02e6e9f6c902afe75f3ea2 (diff)
Do not check auth for get_user
Diffstat (limited to 'src/routes/user.rs')
-rw-r--r--src/routes/user.rs4
1 files changed, 2 insertions, 2 deletions
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<Json<UserList>, AppError> {
Ok(Json(user))
}
-/// Get an user with id = `user_id`. Checks Authorization token
-async fn get_user(Path(user_id): Path<i32>, _: Claims) -> Result<Json<UserList>, AppError> {
+/// Get an user with id = `user_id`
+async fn get_user(Path(user_id): Path<i32>) -> Result<Json<UserList>, AppError> {
match User::find_by_id(user_id).await {
Ok(user) => Ok(Json(user)),
Err(_) => Err(AppError::NotFound("User not found".to_string())),