Skip to content

Commit

Permalink
collab: Add feature flag to bypass account age check (#20843)
Browse files Browse the repository at this point in the history
This PR adds a `bypass-account-age-check` feature flag that can be used
to bypass the minimum account age check.

Release Notes:

- N/A
  • Loading branch information
maxdeviant authored Nov 18, 2024
1 parent fb6c987 commit 80d50f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/collab/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4031,7 +4031,10 @@ async fn get_llm_api_token(
}

let has_llm_subscription = session.has_llm_subscription(&db).await?;
if !has_llm_subscription {

let bypass_account_age_check =
has_llm_subscription || flags.iter().any(|flag| flag == "bypass-account-age-check");
if !bypass_account_age_check {
let mut account_created_at = user.created_at;
if let Some(github_created_at) = user.github_user_created_at {
account_created_at = account_created_at.min(github_created_at);
Expand Down

0 comments on commit 80d50f5

Please sign in to comment.