Skip to content

feat(system-config): add a public system config response contract - #23

Merged
Bccorb merged 1 commit into
mainfrom
feat/public-system-config-schema
Jul 31, 2026
Merged

feat(system-config): add a public system config response contract#23
Bccorb merged 1 commit into
mainfrom
feat/public-system-config-schema

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

First of three PRs adding the ability to skip passkey registration. This one is the contract only.

Why

The bundled sign-in screens render with no session, so they cannot read the system configuration. Today the React SDK falls back to a hardcoded DEFAULT_LOGIN_METHODS = ['passkey', 'magic_link', 'phone_otp'], which does not match this project's own SYSTEM_CONFIG_DEFAULTS.login_methods = ['passkey', 'magic_link']. So a client can advertise a method an instance has turned off, and the configured method list has two sources of truth.

It also blocks a specific gap: registration currently forces a passkey. Offering a skip is only safe when some other login method is enabled, otherwise a user who declines can never sign back in. A client cannot check that today.

What

PublicSystemConfigResponseSchema carries loginMethods and nothing else. Everything else in SystemConfigSchema stays behind the admin routes, and the doc comment says so, so the next person does not treat this as a general-purpose config dump.

.min(1) on the array is deliberate: an empty list would leave a client with nothing to offer and no way to tell that apart from a parse it should retry.

Follow-ups

  • seamless-auth-api: serve this from an unauthenticated GET /system-config/public, alongside the existing public GET /oauth/providers
  • seamless-auth-react: consume it, gate a skip control on the passkey registration screen, and drop the hardcoded fallback

Verification

npm run typecheck, npm test (159 passing), npm run lint, and npm run format:check all clean. Four tests added covering the enum, the empty-list rejection, and that unknown config keys are stripped rather than passed through.

Additive, so a minor changeset. No existing schema, type, or export changes.

The sign-in screens in the SDKs have no session when they render, so they fall
back to a hardcoded list of login methods. That list can advertise a method an
instance has turned off, and it is a second source of truth for something the
server already knows.

PublicSystemConfigResponseSchema is the slice of the configuration a signed-out
client may read. It carries loginMethods and nothing else, so a client can ask
which methods an instance offers rather than guess, and can tell whether
declining a passkey during registration would leave a user with no way back in.

Additive. No existing schema, type, or export changes.
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.

1 participant