YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: support HTTPS redirect URIs for OAuth providers (Calendly)
Louis Beaumont6827116eda98
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/oauth.rs b/apps/screenpipe-app-tauri/src-tauri/src/oauth.rsindex 91272c01e..39974fc87 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/oauth.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/oauth.rs@@ -53,6 +53,8 @@ pub async fn oauth_connect(map.insert(state.clone(), tx);}+ let redirect_uri = config.redirect_uri_override.unwrap_or(OAUTH_REDIRECT_URI);+let mut auth_url = reqwest::Url::parse(config.auth_url).map_err(|e| format!("bad auth_url: {}", e))?;{@@ -60,7 +62,7 @@ pub async fn oauth_connect(pairs.append_pair("client_id", config.client_id).append_pair("response_type", "code")- .append_pair("redirect_uri", OAUTH_REDIRECT_URI)+ .append_pair("redirect_uri", redirect_uri).append_pair("state", &state);for (k, v) in config.extra_auth_params {pairs.append_pair(k, v);@@ -97,7 +99,7 @@ pub async fn oauth_connect(.build().map_err(|e| format!("http client: {}", e))?;- let token_data = oauth::exchange_code(&client, &integration_id, &code, OAUTH_REDIRECT_URI)+ let token_data = oauth::exchange_code(&client, &integration_id, &code, redirect_uri).await.map_err(|e| {error!("token exchange failed for {}: {}", integration_id, e);diff --git a/crates/screenpipe-connect/src/connections/calcom.rs b/crates/screenpipe-connect/src/connections/calcom.rsindex 9b9512c2c..200d8ac4f 100644--- a/crates/screenpipe-connect/src/connections/calcom.rs+++ b/crates/screenpipe-connect/src/connections/calcom.rs@@ -15,6 +15,7 @@ static OAUTH: OAuthConfig = OAuthConfig {auth_url: "https://api.cal.com/oauth/authorize",client_id: "e9e319206428a99bfcb2207e51f827c96c1ed24821458a8633356e80632575dd",extra_auth_params: &[],+ redirect_uri_override: None,};static DEF: IntegrationDef = IntegrationDef {diff --git a/crates/screenpipe-connect/src/connections/calendly.rs b/crates/screenpipe-connect/src/connections/calendly.rsindex f1ee52dec..93239aaf4 100644--- a/crates/screenpipe-connect/src/connections/calendly.rs+++ b/crates/screenpipe-connect/src/connections/calendly.rs@@ -15,6 +15,7 @@ static OAUTH: OAuthConfig = OAuthConfig {auth_url: "https://auth.calendly.com/oauth/authorize",client_id: "ouME2bVF3PpAx45iHSesFYzei_mMeORIsyWXs9XYeQo",extra_auth_params: &[],+ redirect_uri_override: Some("https://screenpi.pe/api/oauth/callback"),};static DEF: IntegrationDef = IntegrationDef {diff --git a/crates/screenpipe-connect/src/connections/github_issues.rs b/crates/screenpipe-connect/src/connections/github_issues.rsindex 8ad70c786..37ef7fed6 100644--- a/crates/screenpipe-connect/src/connections/github_issues.rs+++ b/crates/screenpipe-connect/src/connections/github_issues.rs@@ -14,6 +14,7 @@ static OAUTH: OAuthConfig = OAuthConfig {auth_url: "https://github.com/login/oauth/authorize",client_id: GITHUB_CLIENT_ID,extra_auth_params: &[("scope", "repo")],+ redirect_uri_override: None,};static DEF: IntegrationDef = IntegrationDef {diff --git a/crates/screenpipe-connect/src/connections/notion.rs b/crates/screenpipe-connect/src/connections/notion.rsindex 1db5c90ed..2e5e8dc48 100644--- a/crates/screenpipe-connect/src/connections/notion.rs+++ b/crates/screenpipe-connect/src/connections/notion.rs@@ -12,6 +12,7 @@ static OAUTH: OAuthConfig = OAuthConfig {auth_url: "https://api.notion.com/v1/oauth/authorize",client_id: "334d872b-594c-81f9-9dce-00371097ac7d",extra_auth_params: &[("owner", "user")],+ redirect_uri_override: None,};static DEF: IntegrationDef = IntegrationDef {diff --git a/crates/screenpipe-connect/src/oauth.rs b/crates/screenpipe-connect/src/oauth.rsindex feb9f828e..520bb75c2 100644--- a/crates/screenpipe-connect/src/oauth.rs+++ b/crates/screenpipe-connect/src/oauth.rs@@ -69,6 +69,10 @@ pub struct OAuthConfig {/// Extra query params appended to the authorization URL verbatim./// e.g. `&[("owner", "user")]` for Notion.pub extra_auth_params: &'static [(&'static str, &'static str)],+ /// Override redirect URI for providers that require HTTPS.+ /// When set, this is used instead of the default localhost callback.+ /// The website relays the callback to the local server.+ pub redirect_uri_override: Option<&'static str>,}// ---------------------------------------------------------------------------