diff --git a/account.html b/account.html new file mode 100644 index 0000000..ef8858a --- /dev/null +++ b/account.html @@ -0,0 +1,121 @@ + + + + + +Your account — Solid pod + + + +
+

Your account

+

Loading session…

+ + + + + +
+ + +
+ + + diff --git a/account.html.acl b/account.html.acl new file mode 100644 index 0000000..704c8ef --- /dev/null +++ b/account.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": "./account.html" + }, + "acl:mode": [ + { + "@id": "acl:Read" + } + ] + } + ] +} diff --git a/index.js b/index.js index dc326bd..248927f 100755 --- a/index.js +++ b/index.js @@ -484,6 +484,17 @@ ready.then((ok) => { const signinAclDst = join(options.root, 'signin.html.acl'); if (existsSync(signinAclSrc)) copyFileSync(signinAclSrc, signinAclDst); + // account.html — post-sign-in dashboard. Same overwrite + public- + // read pattern as signin.html. Both pages render their useful + // state from a restored solid-oidc session; signed-out visitors + // see a "sign in" prompt rather than a blank page. + const acctSrc = join(__dirname, 'account.html'); + const acctDst = join(options.root, 'account.html'); + if (existsSync(acctSrc)) copyFileSync(acctSrc, acctDst); + const acctAclSrc = join(__dirname, 'account.html.acl'); + const acctAclDst = join(options.root, 'account.html.acl'); + if (existsSync(acctAclSrc)) copyFileSync(acctAclSrc, acctAclDst); + 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 99480a2..235d8a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jspod", - "version": "0.0.17", + "version": "0.0.18", "description": "JavaScript Solid Pod - Just works, batteries included", "type": "module", "main": "index.js", @@ -14,6 +14,8 @@ "welcome.html", "signin.html", "signin.html.acl", + "account.html", + "account.html.acl", "links.jsonld" ], "scripts": { diff --git a/signin.html b/signin.html index f0eb80c..95a864e 100644 --- a/signin.html +++ b/signin.html @@ -71,7 +71,7 @@

Signing in…

await session.handleRedirectFromLogin(); titleEl.textContent = 'Signed in'; ledeEl.textContent = 'WebID: ' + (session.webId || '(none)') + '. Redirecting…'; - setTimeout(() => { window.location.href = './'; }, 800); + setTimeout(() => { window.location.href = './account.html'; }, 800); } else { // Try to restore a prior session. solid-oidc throws "Missing // refresh data" on a clean first visit — that's fine, it just @@ -86,7 +86,7 @@

Signing in…

if (restored) { titleEl.textContent = 'Already signed in'; ledeEl.textContent = 'WebID: ' + session.webId + '. Redirecting…'; - setTimeout(() => { window.location.href = './'; }, 400); + setTimeout(() => { window.location.href = './account.html'; }, 400); } else { await session.login(idp, redirectUri); } diff --git a/welcome.html b/welcome.html index 889c8eb..29ea02d 100644 --- a/welcome.html +++ b/welcome.html @@ -36,6 +36,7 @@

Your Solid pod

+Account