Title: idp: createAccount without a webId poisons the WebID index — second webId-less account collides · Issue #608 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: idp: createAccount without a webId poisons the WebID index — second webId-less account collides · Issue #608 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: idp: createAccount without a webId poisons the WebID index — second webId-less account collides · Issue #608 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Observed createAccount(...) called without a webId stores the account anyway, and the WebID uniqueness index picks up the literal JSON key "undefined". The first webId-less account succeeds; every subsequent one throws: Error: WebID alre...
Open Graph Description: Observed createAccount(...) called without a webId stores the account anyway, and the WebID uniqueness index picks up the literal JSON key "undefined". The first webId-less account succeeds; every ...
X Description: Observed createAccount(...) called without a webId stores the account anyway, and the WebID uniqueness index picks up the literal JSON key "undefined". The first webId-less account succee...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/608
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"idp: createAccount without a webId poisons the WebID index — second webId-less account collides","articleBody":"## Observed\n\n`createAccount(...)` called without a `webId` stores the account anyway, and the WebID uniqueness index picks up the literal JSON key `\"undefined\"`. The first webId-less account succeeds; every subsequent one throws:\n\n```\nError: WebID already has an account\n at createAccount (src/idp/accounts.js:104)\n```\n\nIn practice this bites on the **first** `createAccount` call an integration test makes, because server startup already creates a webId-less account itself (the remoteStorage user `me`) — so the `\"undefined\"` slot is consumed before user code runs.\n\n## Repro\n\n```js\nprocess.env.DATA_ROOT = fs.mkdtempSync(path.join(os.tmpdir(), 'acct-'));\nconst { createAccount } = await import('javascript-solid-server/src/idp/accounts.js');\n\nawait createAccount({ username: 'lefty', password: 'x', podName: 'lefty' }); // ok — indexes webId \"undefined\"\nawait createAccount({ username: 'rocco', password: 'x', podName: 'rocco' }); // throws: WebID already has an account\n```\n\n(With a running `createServer({ idp: true, ... })` instance the *first* call already throws, courtesy of the auto-created `me` account.)\n\n## Why it happens\n\n`src/idp/accounts.js` `createAccount` destructures `webId` and does:\n\n```js\nconst existingByWebId = await findByWebId(webId); // webIdIndex[undefined] → \"undefined\" key\nif (existingByWebId) throw new Error('WebID already has an account');\n```\n\nthen indexes the new account under the same coerced `\"undefined\"` key.\n\n## Suggested fix (either)\n\n1. Skip the WebID uniqueness check and index write entirely when `webId` is absent (`if (webId) { ... }` around both), or\n2. Derive a WebID at creation time from `podName` + issuer so every account has a real one.\n\nOption 1 is a two-line guard; option 2 is nicer for consumers (accounts always resolvable by WebID) but needs the issuer available in `createAccount`.\n\n## Workaround\n\nAlways pass an explicit `webId`. (That's what the OMERTÀ plugin's integration tests do now, with a comment pointing here.)\n\nFound while building the OMERTÀ plugin (third consumer of the #206 seams — client-authoritative static app, after Tideholm and Bridge); findings log in `solid-apps/mafia` `jss-plugin/NOTES.md`.","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-07-11T10:13:58Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/608"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c047fbd2-a83d-557e-d306-7aa923b8ae3d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C4B4:D713A:A58073:DBE8C6:6B03A672 |
| html-safe-nonce | 4cc1650c4b949f8957dc8095263db7cbca968ffc799b2223ae3d76ec5a5a8610 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEI0OkQ3MTNBOkE1ODA3MzpEQkU4QzY6NkIwM0E2NzIiLCJ2aXNpdG9yX2lkIjoiNTcyNzMwMzEwOTYzODg1ODM1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 47f04bce7fc7c956acf4550402f08b5d23dd06608b7148f044e7a41cb91fb09f |
| hovercard-subject-tag | issue:4861783017 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/608/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4fa3c1167092670e14f24e786e3f8182104d338dc376934a45ad4e22f4dce81d/JavaScriptSolidServer/JavaScriptSolidServer/issues/608 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4fa3c1167092670e14f24e786e3f8182104d338dc376934a45ad4e22f4dce81d/JavaScriptSolidServer/JavaScriptSolidServer/issues/608 |
| og:image:alt | Observed createAccount(...) called without a webId stores the account anyway, and the WebID uniqueness index picks up the literal JSON key "undefined". The first webId-less account succeeds; every ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width