Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/core/src/api/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ use derive_variants::{EnumVariants, ExtractVariant};
use komodo_client::{api::auth::*, entities::user::User};
use resolver_api::Resolve;
use response::Response;
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
use serde_json::json;
use serror::Json;
use serror::{Json, AddStatusCode};
use typeshare::typeshare;
use uuid::Uuid;

Expand Down Expand Up @@ -152,7 +153,7 @@ impl Resolve<AuthArgs> for GetUser {
self,
AuthArgs { headers }: &AuthArgs,
) -> serror::Result<User> {
let user_id = get_user_id_from_headers(headers).await?;
let user_id = get_user_id_from_headers(headers).await.status_code(StatusCode::UNAUTHORIZED)?;
Ok(get_user(&user_id).await?)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ok(get_user(&user_id).await?)
get_user(&user_id).await.status_code(StatusCode::UNAUTHORIZED)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@mbecker20 mbecker20 Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-check, this is on get_user. Currently it will 500 if it can't find user at id.

}
}