Implement browser OAuth for ChatGPT subscriptions

Update app branding and OAuth callback handling, remove legacy Samsung
theme aliases, prune unavailable ChatGPT models, and delete cost data.
This commit is contained in:
Ryan Ward
2026-08-10 17:26:47 -05:00
parent 88ad290c7e
commit 10412c4c6f
11 changed files with 369 additions and 3774 deletions
+13 -1
View File
@@ -112,6 +112,8 @@ pub enum UriHost {
TabConfig,
/// Focuses a specific terminal pane by its persistent session UUID.
Session,
/// Handles OAuth callbacks for ChatGPT subscription authorization.
ChatGPT,
}
impl FromStr for UriHost {
@@ -135,6 +137,7 @@ impl FromStr for UriHost {
"linear" => Ok(Self::Linear),
"tab_config" if FeatureFlag::TabConfigs.is_enabled() => Ok(Self::TabConfig),
"session" => Ok(Self::Session),
"chatgpt" => Ok(Self::ChatGPT),
_ => Err(anyhow!("Received url with unexpected host: {}", s)),
}
}
@@ -570,6 +573,13 @@ impl UriHost {
log::warn!("session deep link could not find pane with given UUID");
}
}
UriHost::ChatGPT => {
#[cfg(not(target_family = "wasm"))]
{
crate::ai::chatgpt_auth::ChatGPTAuthModel::handle(ctx)
.update(ctx, |model, ctx| model.handle_oauth_callback(url, ctx));
}
}
}
}
@@ -595,6 +605,7 @@ impl UriHost {
// Handler picks the window itself based on `?new_window=true`.
Self::TabConfig => W::Nothing,
Self::Session => W::Nothing,
Self::ChatGPT => W::Nothing,
}
}
}
@@ -1669,7 +1680,8 @@ fn validate_custom_uri(url: &Url) -> Result<UriHost> {
| UriHost::Codex
| UriHost::Linear
| UriHost::TabConfig
| UriHost::Session => true,
| UriHost::Session
| UriHost::ChatGPT => true,
// Auth and Home only allow the desktop redirect path
UriHost::Auth | UriHost::Home => false,
};