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:
+13
-1
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user