Skip to content

Hide /idp Create Account button in single-user mode (#290)#291

Merged
melvincarvalho merged 1 commit into
JavaScriptSolidServer:gh-pagesfrom
melvincarvalho:issue-290-single-user-landing
Apr 22, 2026
Merged

Hide /idp Create Account button in single-user mode (#290)#291
melvincarvalho merged 1 commit into
JavaScriptSolidServer:gh-pagesfrom
melvincarvalho:issue-290-single-user-landing

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Fixes #290.

Symptom

In single-user mode, `POST /.pods` and `GET /idp/register` both 403 (registration is disabled). The `/idp` landing kept the Create Account button anyway, so clicking it landed on a "Registration Disabled" error page. Live on https://melvin.me/idp before this PR.

Change

Thread `singleUser` from `idp/index.js` into `landingPage(ctx)`. When the flag is set:

  • Hide the Create Account button (no dead-end).
  • Subtitle becomes "Single-user pod — sign in from any Solid app."
  • Sign-in note opens with "Sign in" rather than "Already have an account?" — registration isn't an option here. Pilot link unchanged.

Pure rendering change — no new routes, no behaviour change for multi-user deployments.

Files

  • `src/idp/index.js` — pass `singleUser` into the landing's ctx (~1 line).
  • `src/idp/views.js` — branch button + subtitle + note copy on `ctx.singleUser` (~10 lines).
  • `test/idp.test.js` — new "Single-user mode landing" describe block (~50 lines): asserts button + register link absent, single-user subtitle present, pilot link still present.

Test plan

  • Full suite: 398/398 pass (was 394; +4 cases for single-user mode landing including subtitle + button absence + register-link absence).
  • Manual: open https://melvin.me/idp after upgrade — Create Account button should be gone, subtitle reflects single-user, sign-in note still names pilot.

…erver#290)

In single-user mode pod creation is disabled — POST /.pods and
GET /idp/register both return 403. The /idp landing kept the Create
Account button anyway, so a user clicking it on (e.g.) melvin.me
landed on a Registration Disabled error page.

Thread `singleUser` from idp/index.js into landingPage(ctx). When the
flag is set:

- Hide the Create Account button entirely.
- Subtitle becomes "Single-user pod — sign in from any Solid app."
- Sign-in note opens with "Sign in" rather than "Already have an
  account?" since registration isn't an option here. Pilot stays
  named as the example client.

Pure rendering change — no new routes, no new behaviour, just stops
the landing from offering a button it can't honour. Multi-user
deployments are unchanged.

Test: new "Single-user mode landing" describe block spins a server
with `singleUser: true`, asserts the body has no Create Account
button or /idp/register link, and confirms the subtitle reflects the
single-user shape. Pilot link is still asserted present.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the IdP landing page rendering so that, in single-user mode (where registration is disabled), the /idp page no longer presents a “Create Account” call-to-action that would lead users to a 403 page.

Changes:

  • Thread singleUser from src/idp/index.js into landingPage(ctx) rendering context.
  • Conditionally suppress the “Create Account” button and adjust subtitle/sign-in copy in src/idp/views.js.
  • Add regression tests covering the single-user /idp landing behavior (no register CTA/link; updated subtitle; pilot link remains).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/idp/index.js Passes singleUser option into the landing page render context.
src/idp/views.js Adds ctx.singleUser-based branching to hide registration CTA and adjust copy.
test/idp.test.js Adds a single-user-mode landing page test block to prevent regressions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@melvincarvalho
melvincarvalho merged commit 42a82a1 into JavaScriptSolidServer:gh-pages Apr 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/idp landing 'Create Account' button leads to 403 in single-user mode

2 participants