From 19788260748432e78d5dbc9c8fef668876ebc42e Mon Sep 17 00:00:00 2001 From: Melvin Carvalho Date: Sat, 16 May 2026 08:39:00 +0200 Subject: [PATCH] feat: ship a tiny sign-in app at /signin.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the "Sign in → /idp → 'go find a Solid app'" detour with a real OIDC client baked into jspod. Welcome page's Sign in button now points at /signin.html. What signin.html does: - Imports solid-oidc (zero-dep, AGPL, same JavaScriptSolidServer org as JSS and jspod) from a version-pinned jsdelivr URL - On fresh visit: tries to restore prior session; if none, calls session.login(thisPod, /signin.html). solid-oidc handles dynamic client registration, PKCE, DPoP. Browser is redirected to JSS's /idp/auth with OAuth params — at which point JSS renders its real Passkey / Schnorr / username+password form - On return (?code= present): session.handleRedirectFromLogin() exchanges code for DPoP-bound tokens, stores them in IndexedDB, redirects user back to the pod root Collapses ~6 context switches (welcome → /idp message → Pilot → type pod URL → /idp form → me/me → back) down to 2 (welcome → /idp form → me/me → back). ACL: signin.html ships with a sibling signin.html.acl giving public read (mirrors JSS's index.html.acl pattern), so the page is reachable before any session exists. Implementation: - signin.html (~4 KB) — single-file static page - signin.html.acl — public-read for the page itself - welcome.html — Sign in href changes from ./idp to ./signin.html - index.js — always-overwrite copy alongside welcome.html - package.json — files whitelist + 0.0.17 bump Known follow-up (not in this PR): after sign-in, the welcome page's locked-tile probe still uses plain fetch and so the tiles stay dimmed. Auth-aware probes need solid-oidc on welcome.html too, OR a separate /account.html dashboard. Tracking as next step. Refs #1 --- index.js | 11 ++++++ package.json | 4 +- signin.html | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ signin.html.acl | 23 ++++++++++++ welcome.html | 2 +- 5 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 signin.html create mode 100644 signin.html.acl diff --git a/index.js b/index.js index 65e075f..dc326bd 100755 --- a/index.js +++ b/index.js @@ -473,6 +473,17 @@ ready.then((ok) => { const indexDst = join(options.root, 'index.html'); if (existsSync(indexSrc)) copyFileSync(indexSrc, indexDst); + // signin.html is a jspod-owned static page; always-overwrite so + // upgrades to the sign-in flow ship immediately. Pair with a .acl + // granting public read so unauthenticated visitors can reach it + // (mirrors JSS's index.html.acl pattern). + const signinSrc = join(__dirname, 'signin.html'); + const signinDst = join(options.root, 'signin.html'); + if (existsSync(signinSrc)) copyFileSync(signinSrc, signinDst); + const signinAclSrc = join(__dirname, 'signin.html.acl'); + const signinAclDst = join(options.root, 'signin.html.acl'); + if (existsSync(signinAclSrc)) copyFileSync(signinAclSrc, signinAclDst); + const linksSrc = join(__dirname, 'links.jsonld'); const linksDst = join(options.root, 'public', 'links.jsonld'); if (existsSync(linksSrc) && !existsSync(linksDst)) { diff --git a/package.json b/package.json index 21f4e49..99480a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jspod", - "version": "0.0.16", + "version": "0.0.17", "description": "JavaScript Solid Pod - Just works, batteries included", "type": "module", "main": "index.js", @@ -12,6 +12,8 @@ "data-browser.js", "data-browser.css", "welcome.html", + "signin.html", + "signin.html.acl", "links.jsonld" ], "scripts": { diff --git a/signin.html b/signin.html new file mode 100644 index 0000000..f0eb80c --- /dev/null +++ b/signin.html @@ -0,0 +1,99 @@ + + + + + +Sign in — Solid pod + + + +
+

Signing in…

+

Starting Solid-OIDC handshake with this pod.

+
+Default sign-in: me / me +
+
+ + +
+ + + diff --git a/signin.html.acl b/signin.html.acl new file mode 100644 index 0000000..c0f3d58 --- /dev/null +++ b/signin.html.acl @@ -0,0 +1,23 @@ +{ + "@context": { + "acl": "http://www.w3.org/ns/auth/acl#", + "foaf": "http://xmlns.com/foaf/0.1/" + }, + "@graph": [ + { + "@id": "#public", + "@type": "acl:Authorization", + "acl:agentClass": { + "@id": "foaf:Agent" + }, + "acl:accessTo": { + "@id": "./signin.html" + }, + "acl:mode": [ + { + "@id": "acl:Read" + } + ] + } + ] +} diff --git a/welcome.html b/welcome.html index 962def2..889c8eb 100644 --- a/welcome.html +++ b/welcome.html @@ -35,7 +35,7 @@

Your Solid pod

Running at this server.

- +