PhoenixKit 2.15.1: Choose which account types the signup page opens
PhoenixKit 2.15.1 lets a site with organization accounts decide what the signup page may open, and closes a hole that let anyone create an organization account the site did not offer.
With organization accounts on, /admin/settings/users has a new setting, Account types on the signup page, with three choices: Visitor chooses (the picker, as before and the default), Personal accounts only and Organization accounts only. With organizations only, the picker disappears, the organization name is required and staff join by invitation. The magic-link signup form follows the same setting.
The account type was not checked on the server. A forged form could create an organization account even on a site with organization accounts switched off. Both signup forms now enforce the setting. A visitor signing up from an organization invitation is now always given a personal account; choosing Organization there used to create a second organization, and the invitation could never be used.
Full release notes: PhoenixKit 2.15.1
2.15.1 · 5 September 2026
Added
-
A B2B site can stop asking whether an account is personal. With organization accounts on, the signup page has always shown a Personal / Organization picker — a dead question on a site where every account is a company. A new Account types on the signup page setting (
registration_account_type, on/admin/settings/usersbeside the feature switch) takes three values:Mode Signup page "choice"the picker, as before — the default, and what every existing install keeps "person"no picker; organizations exist, but only an admin creates them "organization"no picker; Organization Name required, and staff join by invitation Auth.registration_account_type/0collapses this with the master switch, so one call answers “what may this form create?” — it returns"person"whenever organization accounts are off.The magic-link completion form honours the same policy: it has no picker, so it grows the Organization Name field (and drops first/last name, which an organization has neither of) exactly in
"organization"mode.
Fixed
-
The account type was never enforced server-side.
registration_changeset/3castsaccount_typeandorganization_namestraight from the payload, and aphx-submitpayload is whatever the client sends — so a forgeduser[account_type]=organizationcreated an organization account on a site with organization accounts switched off entirely, where the picker had never been rendered. Both public forms now pipe their params throughAuth.enforce_registration_account_type/2inside their field allowlist, the same arrangement that makesremember_me_enabledhold at the cookie writer. In"choice"mode an unknown string normalises to"person"rather than reaching the insert and coming back as a CHECK-constraint 500. -
An organization invitation no longer offers “Organization”. A visitor registering from an invitation link saw the full picker, and choosing Organization created a second organization — which cannot hold an
organization_uuid, so the invitation could never be redeemed. The invitation now pins the signup to a person account, on the page and in the payload.
PhoenixKit 2.15.1. Install or update: {:phoenix_kit, "~> 2.15"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.