From 253635ffef39e55128896d042b04ecc727ea8e5d Mon Sep 17 00:00:00 2001 From: Oleg Lukasonok Date: Sun, 8 Nov 2026 19:56:53 +0200 Subject: [PATCH] Sign-in ends on a page with a button back to the editor Browsers open an app link only after a click on the page. With a live identity provider session the whole sign-in ran without one, so the redirect to vscode:// was dropped and the editor never got its code. The page opens the editor at once and keeps a button for when that is held back. Server 0.1.4, chart 0.1.5. --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- charts/archify-sync/Chart.yaml | 4 ++-- crates/server/src/pages.rs | 13 ++++++++++++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2522e0c..ff85a31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ dependencies = [ [[package]] name = "archify-sync-protocol" -version = "0.1.3" +version = "0.1.4" dependencies = [ "chrono", "serde", @@ -53,7 +53,7 @@ dependencies = [ [[package]] name = "archify-sync-server" -version = "0.1.3" +version = "0.1.4" dependencies = [ "anyhow", "archify-sync-protocol", @@ -83,7 +83,7 @@ dependencies = [ [[package]] name = "archify-sync-store" -version = "0.1.3" +version = "0.1.4" dependencies = [ "chrono", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 7d591fb..ca72998 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/protocol", "crates/store", "crates/server"] [workspace.package] -version = "0.1.3" +version = "0.1.4" edition = "2024" license = "MIT" repository = "https://gitea.lego-cloud.eu/vscode-extensions/archify-vscode-ext-sync" diff --git a/charts/archify-sync/Chart.yaml b/charts/archify-sync/Chart.yaml index 2e99344..a8df2dc 100644 --- a/charts/archify-sync/Chart.yaml +++ b/charts/archify-sync/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: archify-sync description: Archify Sync, live and shared Archify models for VS Code type: application -version: 0.1.4 -appVersion: "0.1.3" +version: 0.1.5 +appVersion: "0.1.4" annotations: artifacthub.io/license: MIT sources: diff --git a/crates/server/src/pages.rs b/crates/server/src/pages.rs index ee92219..8dd8cff 100644 --- a/crates/server/src/pages.rs +++ b/crates/server/src/pages.rs @@ -314,7 +314,18 @@ async fn complete(state: &AppState, q: &AuthorizeQuery, account: &AccountRow) -> .query_pairs_mut() .append_pair("code", &code) .append_pair("state", &q.state); - Redirect::to(target.as_str()).into_response() + // A page, not a redirect: browsers open an app link only after a click on + // the page, and with a live identity provider session nobody clicked. The + // page tries at once and keeps a button for when the browser held back. + let link = escape(target.as_str()); + page( + state, + "Signed in", + &format!( + r#"

Signed in as {}

Your editor finishes the sign-in. If it did not open, use the button.

Open the editor
"#, + escape(&account.display_name), + ), + ) } async fn sign_in(state: &AppState, form: &AuthorizeForm) -> Result {