Forms — Versola Docs
VersolaVersola/docs
Pre-1.00.7.1versola.kzGitHub

Forms

The Forms screen of the admin console — the sign-in screens that auth shows, their versions and active version, translations, preview and the themes that style them.

A form is one screen of the sign-in flow that auth renders in the browser: the login field, the password, the one-time code, consent and so on. The Forms screen lists them, keeps their versions, lets you switch the active version and manages the themes that style them. Read the section on what the console can and cannot change before you edit a form.

Before you start

Forms sits under GLOBAL in the sidebar. Forms and locales are shared by all tenants; themes can be global or belong to one tenant, so the theme list follows the tenant selected in the sidebar. You need forms:read to see the screen. Creating a version, switching the active version and creating, editing or deleting a theme need forms:manage.

How forms reach the sign-in screens

Each form has an ID, and auth asks for forms by fixed ID. A form is made of:

  • a compiled Solid.js script, the part that runs in the browser;
  • its source (TSX), stored next to it;
  • a CSS file for the form;
  • translations, one set of strings per language;
  • backend properties, the values the backend passes into the form.

The built-in forms are written in the central-ui/forms/ directory of the product repository. npm run build:forms there compiles each one and places the script, source, CSS and translations in the resources of central, which loads them into the database on start.

Form IDShown when
credentialThe user enters a login, email or phone number, or chooses a passkey.
passwordThe user enters a password.
set-passwordThe user must set a new password, for example after signing in with a temporary one.
otpThe user enters a one-time code.
passkey-enrollauth offers to register a passkey.
consentThe client asks the user to approve scopes.
access-deniedThe user is blocked, for example after too many failed attempts.
conversation-expiredThe sign-in took too long and the conversation is gone.
service-unavailableauth cannot continue.
confirm-logout/logout asks the user to confirm.
signed-outThe user has been signed out.
auth-settingsThe account page with the user’s sessions and passkeys.

auth renders only the active version of a form, with the translations of the languages that are active on the Locales page. If a form is missing, auth answers with a plain “not found” page.

The list

Forms — one card per form ID, then the Themes section
Forms page with the twelve built-in forms collapsed and a Themes section below them

Click a card to see its versions, newest first. Each version shows its number (v1), an Active badge on the one auth serves, and Set Active on the others. Expand a version to see the Theme selector, the controls for its backend properties and a Preview button.

An expanded form: v1 is active
The consent form expanded: version v1 with the Active badge, the Theme selector set to default and a Preview button

Preview renders the form in a frame. You can change the theme, the language, the width and the values of the backend properties to see each state. The preview runs the stored compiled script.

Versions and rollback

ActionWhat happens
Save a versionSave as new version adds the next number (v2, v3, and so on). It does not activate it, except for the first version of a form, which is active at once.
Set ActiveMakes that version the active one and deactivates the others. It works on any listed version, so it is also the rollback.
RetentionCentral keeps the five newest versions and the active one. Older inactive versions are deleted when you save.

A version is never edited in place. To change a form, click the + on its card (New Version), edit, save, then Set Active on the new version. If it misbehaves, Set Active on the previous version. auth picks the change up on its next configuration sync, not instantly.

Edit a form

The + next to Forms creates a form with a new ID. auth only asks for the IDs in the table above, so a form with another ID is stored but never shown.

New Version — the editor for a form, based on v1
New Version page for the consent form with the Solid.js source, per-form CSS, the English and Russian localization fields, backend properties, theme and preview controls, and the Save as new version button
SectionWhat it holds
Solid.js Source (JSX/TSX)The source of the form components.
Per-form CSSStyles for this form, applied on top of the theme.
LocalizationsOne tab per language that exists on the Locales page. Each placeholder found in the template is a row; the value is the text for that language.
Backend PropertiesBoolean, AnyOf (a list of allowed values) and Number properties, added with + Add Boolean, + Add AnyOf and + Add Number. The preview uses them.
Theme and PreviewA theme and a preview of the unsaved form.

Note: The console has no compiler. Save as new version sends the compiled script of the version you started from unchanged, together with the text in the source editor. Changing the Solid.js source in the console therefore does not change what users see. CSS, translations and backend properties do take effect. To change the behaviour of a form, build it outside the console and send the compiled script in the jsCompiled field of PUT /configuration/forms in the Central API.

The backend properties of the built-in forms are declared, but the values come from elsewhere. credential declares primaryCredentials, inlinePassword and passkey, which auth takes from the client’s sign-in settings. otp declares length and resendAfter, which come from the tenant’s challenge settings.

Warning: When the configuration of central has a bootstrap block, central compares the active version of each built-in form with the copy bundled in its image on every start. If they differ, it saves the bundled copy as a new version and makes it active. Your edit stays in the version list and you can activate it again, but the next restart replaces it once more. The central.conf that versola configure generates has a bootstrap block.

Themes

A theme is a block of CSS that styles every form. A client selects its theme in Forms Theme on its page (Client); a client that selects none, or whose theme is empty, gets the default theme.

Themes — the global default theme
Forms page with the Themes section expanded, showing the global theme default with a pencil icon

Open Themes to see the global themes and, under This tenant, the themes of the selected tenant. The + opens New Theme.

FieldMeaning
Theme IDThe name clients select, for example acme-dark. Fixed after creation.
ScopeGlobal (every tenant) or This tenant (the tenant selected in the sidebar). Chosen when you create the theme.
CSSThe styles.

Click a theme’s pencil to edit its CSS; Delete is on the edit page. You cannot delete the default theme, and a theme that a client still uses cannot be deleted either (the API answers with a conflict). On start, central also resets default to the stylesheet bundled in its image when the two differ, the same way as for forms. Put your own styles in a new theme and select it in the client instead of editing default.

Next steps

  • Locales — which languages auth offers, and what an active language needs
  • Client — choose the theme a client uses
  • Scope — the scope and claim descriptions the consent form shows