collab: Return feature flags with authenticated user (#29455)

This PR makes it so the `GET /user` endpoint returns the user's feature
flags with the authenticated user.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-04-25 21:49:25 -04:00 committed by GitHub
parent d46890978a
commit ce31312268
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -152,6 +152,7 @@ struct AuthenticatedUserParams {
struct AuthenticatedUserResponse { struct AuthenticatedUserResponse {
user: User, user: User,
metrics_id: String, metrics_id: String,
feature_flags: Vec<String>,
} }
async fn get_authenticated_user( async fn get_authenticated_user(
@ -172,7 +173,12 @@ async fn get_authenticated_user(
) )
.await?; .await?;
let metrics_id = app.db.get_user_metrics_id(user.id).await?; let metrics_id = app.db.get_user_metrics_id(user.id).await?;
Ok(Json(AuthenticatedUserResponse { user, metrics_id })) let feature_flags = app.db.get_user_flags(user.id).await?;
Ok(Json(AuthenticatedUserResponse {
user,
metrics_id,
feature_flags,
}))
} }
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]