Login version (/u and /u2)
AuthHero serves two universal logins: the widget login at /u2 and the classic login at /u. The classic login is deprecated and will be removed in 1.0.
How the version is chosen
- Application override.
client_metadata.universal_login_versionon the application:"2"→/u2,"1"→/u. Set it on the application's details tab in the admin ("Login version"), or leave it on "Inherit from tenant". - Tenant flag. Otherwise the tenant flag
flags.universal_login_versiondecides:"2"→/u2,"1"or unset →/u. Toggle it in the admin under Settings → Feature Flags ("Use the widget login (/u2)"), or withPATCH /api/v2/tenants/settings.
Existing tenants have no flag, so nothing changes on upgrade: each application keeps the version its own override gives it. New tenants created by seed or the multi-tenancy POST /tenants get "2".
Device-flow and /connect logins always use /u2.
Migrating a tenant
The login-migration CLI in the authhero package works against a kysely database. Set DATABASE_URL to a PlanetScale URL or a SQLite file path:
bash
DATABASE_URL=... pnpm authhero login-migration countcountlists the tenants that still have applications on/u, with totals.check --tenant <id>(or--all) prints the checklist for a tenant. Add--base-url https://login.example.comto also check that the widget bundle is served.flip --tenant <id>sets the tenant flag to"2". Applications pinned to"1"stay on/uand are listed. It also setsbranding.dark_modeto"light"andbranding.dark_mode_toggletofalse, so the login stays light until you've checked a dark variant and turned the toggle back on. The output shows the previous values underbranding.from. Use--dry-runfirst.rollback --tenant <id>removes the tenant flag again. Application overrides are never changed, so this restores the earlier routing when the tenant had no flag or"1"beforeflip. If it had another value, note thefromvalue thatflipprints and set it back yourself. The branding is left asflipset it;/uignores both settings.
Checklist
check reports these items:
- Tenant setting and overrides. Applications pinned to
/u, or with an unrecognised value. - Theme. Without a stored theme
/u2renders the built-in default theme. - Custom pages. Applications with
custom_login_pageorform_template, which/u2does not render. Also the tenant's universal login template, which only/u2renders, so it takes effect when you flip. - Prompt settings and customizations.
identifier_first,password_first, and the number of custom text entries and prompt partials to review on/u2. - Terms URL. Applications without a terms link (
tos_uri,termsAndConditionsUrl, or the brandingterms_url). - Widget. With
--base-url, whether/widget/authhero-widget.esm.jsis served (throughwidgetHandleror static assets).