Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix(desktop-gpui): match saved uploads to the server by origin
Aditya Garudf45403bcb199
diff --git a/apps/desktop-gpui/src/auth.rs b/apps/desktop-gpui/src/auth.rsindex 0ddbed2aa..4fae01f01 100644--- a/apps/desktop-gpui/src/auth.rs+++ b/apps/desktop-gpui/src/auth.rs@@ -299,7 +299,7 @@ impl UploadRequestContext {current_server: &str,current_auth: &serde_json::Map<String, Value>,) -> Result<String, AuthApiError> {- if current_server != self.server_url+ if !has_same_origin(current_server, &self.server_url)|| current_auth.get("user_id").and_then(Value::as_str) != Some(self.owner_id.as_str()){return Err(AuthApiError::InvalidAuthentication);@@ -867,6 +867,12 @@ mod upload_context_tests {.unwrap(),"refreshed-credential");+ assert_eq!(+ context+ .credentials_from("https://original.invalid:443", &refreshed)+ .unwrap(),+ "refreshed-credential"+ );assert!(context.credentials_from("https://changed.invalid", &refreshed)diff --git a/apps/desktop-gpui/src/upload/queue.rs b/apps/desktop-gpui/src/upload/queue.rsindex 6cf371979..b9b5fafec 100644--- a/apps/desktop-gpui/src/upload/queue.rs+++ b/apps/desktop-gpui/src/upload/queue.rs@@ -377,7 +377,7 @@ struct LiveBackend;impl UploadBackend for LiveBackend {fn check_account(&self, state: &UploadState) -> Result<(), String> {- if state.server_url != auth::server_url()+ if !auth::has_same_origin(&state.server_url, &auth::server_url())|| state.owner_id != owner_id()|| store_auth_missing(){