From e147e9395ff17fbbce798cdea0f82ae0591d5a5c Mon Sep 17 00:00:00 2001 From: Melvin Carvalho Date: Sat, 16 May 2026 09:33:25 +0200 Subject: [PATCH] feat: welcome.html is auth-aware (completes MVP) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The welcome page now reflects sign-in state instead of looking identical regardless of whether the user is authenticated. Behaviour change on first paint: Signed out (unchanged from before): - "Sign in" button revealed by HEAD probe to /idp/register - "Default sign-in: me / me" credentials block visible - Tiles probed with plain fetch — /private/, /inbox/, /settings/ 401 → dimmed and rerouted to /signin.html Signed in (new): - "Sign in" button stays hidden - Credentials block hidden (the user has already climbed past it) - Green "signed in as " note pointing to /account.html - All tiles probed via session.authFetch — DPoP-bound bearer attached, /private/ etc. return 200 → tiles stay lit and navigate correctly Implementation: solid-oidc imported as an ES module, same version-pinned jsdelivr URL as the other auth-aware pages. session.restore() on load decides which branch to render. The familiar "Missing refresh data" throw on a clean first visit is caught and treated as "not signed in." Locked-tile fallback link changed from ./idp (which 403s in single-user mode) to ./signin.html (which actually starts a flow). Bumps jspod to 0.0.21. Refs #1 --- package.json | 2 +- welcome.html | 110 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 83 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 68a980e..d872c11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jspod", - "version": "0.0.20", + "version": "0.0.21", "description": "JavaScript Solid Pod - Just works, batteries included", "type": "module", "main": "index.js", diff --git a/welcome.html b/welcome.html index 29ea02d..fc8821a 100644 --- a/welcome.html +++ b/welcome.html @@ -21,6 +21,7 @@ .btn-secondary{background:#fff;color:#222;border-color:#ddd} .btn-secondary:hover{background:#f0efeb} [hidden]{display:none!important} +.signed-in-note{background:#e8f5e9;color:#1b5e20;padding:.6em 1em;border-radius:8px;margin:1em 0;font-size:.95em} .dirs{list-style:none;padding:0;margin:1em 0 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.5em} .dirs li a{display:block;padding:.7em .9em;background:#f3eee5;border-radius:8px;color:#222} .dirs li a:hover{background:#ebe5d8} @@ -40,11 +41,15 @@

Your Solid pod

-
+
Default sign-in: me / me
-

Then point a Solid app (e.g. Pilot) at this server and sign in. Or explore your pod directly:

+ + +

Then point a Solid app (e.g. Pilot) at this server and sign in. Or explore your pod directly:

-