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.
This commit is contained in:
1 parent
50d3d81b78
commit
253635ffef
4 files changed
+18
-7
No files matched your search
Generated
+3
-3
@@ -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",
|
||||
|
||||
+1
-1
@@ -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"
|
||||
@@ -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:
|
||||
|
||||
@@ -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#"<meta http-equiv="refresh" content="0;url={link}"><div class="card"><h2>Signed in as {}</h2><p class="muted">Your editor finishes the sign-in. If it did not open, use the button.</p><a class="button" href="{link}">Open the editor</a></div>"#,
|
||||
escape(&account.display_name),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
async fn sign_in(state: &AppState, form: &AuthorizeForm) -> Result<AccountRow, ApiErr> {
|
||||
|
||||
Reference in new issue
Block a user