collab: Include subscription_period in LLM token claims (#28819)

This PR updates the LLM token claims to include the user's active
subscription period.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-04-15 19:25:41 -04:00 committed by GitHub
parent 102ea6ac79
commit 68ec1d724c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 6 deletions

View file

@ -4135,7 +4135,8 @@ async fn get_llm_api_token(
Err(anyhow!("terms of service not accepted"))?
}
let has_llm_subscription = session.has_llm_subscription(&db).await?;
let has_legacy_llm_subscription = session.has_llm_subscription(&db).await?;
let billing_subscription = db.get_active_billing_subscription(user.id).await?;
let billing_preferences = db.get_billing_preferences(user.id).await?;
let token = LlmTokenClaims::create(
@ -4143,8 +4144,9 @@ async fn get_llm_api_token(
session.is_staff(),
billing_preferences,
&flags,
has_llm_subscription,
has_legacy_llm_subscription,
session.current_plan(&db).await?,
billing_subscription,
session.system_id.clone(),
&session.app_state.config,
)?;