mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-10-23 00:03:24 +00:00
The registration page had two steps: `/register` picked between a password and an upstream provider, then `/register/password` collected the username, email and password. Both now live on `/register`, whose `POST` handler runs the provider branch first and otherwise hands the form to the registration body, which stays in `password.rs` as a helper. The page renders the username, email, password and terms-of-service fields, the captcha and the provider buttons in a single form. The provider buttons submit that same form, so they are marked `formnovalidate` to skip the validation of the fields they do not use, and come after the primary submit button so that Enter still registers. `/register/password` is gone; a `GET` on it redirects to `/register` with the query string it was given, so bookmarks and links keep working. Its `?username=` prefill has no producer left and is dropped. `GET /register` now renders the page whenever password registration is enabled, instead of redirecting to `/register/password` when there is no upstream provider. Without password registration, a single provider still gets redirected to directly, and no provider at all now redirects to `/login`, where `/register/password` used to send that case. An unknown or disabled provider gives a 404 through an inline `GenericError` rather than the route-wide `RouteError`, and an expired CSRF token on the password path now sends the user back to `/register` instead of failing the request.