Skip to content

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

Description

@melvincarvalho

Symptom

On a server started with `--single-user`, the `/idp` landing page (added in #287) renders the Create Account button pointing at `/idp/register`. Clicking it returns a 403 with the message "Registration Disabled / This server is running in single-user mode. Registration is not available." — see `src/idp/index.js` lines 283–296.

So the landing's primary CTA is a dead-end in the most common JSS deployment shape.

Reproduction (using a public deployment): https://melvin.me/idp → click Create Account → 403.

Why this matters

Single-user mode is JSS's default for personal pods (`--single-user --single-user-name ` is what most operators use). The landing page is otherwise correct and useful — only the primary button needs to know about the deployment shape.

Proposed fix

Thread the `singleUser` flag from `idp/index.js` into `landingPage(ctx)` (already takes a `ctx` object). When `singleUser` is truthy, render a different primary affordance:

```
This server runs in single-user mode — only one account is configured.
[ Sign In ] ← when standalone /idp/login lands; for now, just a sign-in note
```

Or in the immediate term: hide the Create Account button entirely and surface only the sign-in note.

Either way, no 403 from the landing's main CTA.

Scope

  • `src/idp/index.js`: pass `singleUser` into the `landingPage` ctx (~3 lines).
  • `src/idp/views.js`: branch the button rendering on `ctx.singleUser` (~10 lines).
  • `test/idp.test.js`: add a single-user variant of the landing test that asserts no link to `/idp/register` (~15 lines).

Trivial PR.

Non-goals

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions