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
994df0d675
commit
7da2be887d
4 files changed
+18
-7
No files matched your search
Generated
+3
-3
@@ -43,7 +43,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "archify-sync-protocol"
|
name = "archify-sync-protocol"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -53,7 +53,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "archify-sync-server"
|
name = "archify-sync-server"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"archify-sync-protocol",
|
"archify-sync-protocol",
|
||||||
@@ -83,7 +83,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "archify-sync-store"
|
name = "archify-sync-store"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ resolver = "3"
|
|||||||
members = ["crates/protocol", "crates/store", "crates/server"]
|
members = ["crates/protocol", "crates/store", "crates/server"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://gitea.lego-cloud.eu/vscode-extensions/archify-vscode-ext-sync"
|
repository = "https://gitea.lego-cloud.eu/vscode-extensions/archify-vscode-ext-sync"
|
||||||
@@ -2,8 +2,8 @@ apiVersion: v2
|
|||||||
name: archify-sync
|
name: archify-sync
|
||||||
description: Archify Sync, live and shared Archify models for VS Code
|
description: Archify Sync, live and shared Archify models for VS Code
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.4
|
version: 0.1.5
|
||||||
appVersion: "0.1.3"
|
appVersion: "0.1.4"
|
||||||
annotations:
|
annotations:
|
||||||
artifacthub.io/license: MIT
|
artifacthub.io/license: MIT
|
||||||
sources:
|
sources:
|
||||||
|
|||||||
@@ -314,7 +314,18 @@ async fn complete(state: &AppState, q: &AuthorizeQuery, account: &AccountRow) ->
|
|||||||
.query_pairs_mut()
|
.query_pairs_mut()
|
||||||
.append_pair("code", &code)
|
.append_pair("code", &code)
|
||||||
.append_pair("state", &q.state);
|
.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> {
|
async fn sign_in(state: &AppState, form: &AuthorizeForm) -> Result<AccountRow, ApiErr> {
|
||||||
|
|||||||
Reference in new issue
Block a user