§5.2
Login, registration and recovery
- Phase 10.3
These pages are in the auth region. If the theme has authheader.wcp and authfooter.wcp they wrap the page, otherwise header / footer. Shared variables:
$csrf$links(login,register—nullwhen registration is closed —,forgot,recovery)$client_assets(css,js): the core form script and style. Core blocks work with these;authheadermust load them.
| File | Main variables |
|---|---|
login.wcp |
$open, $registration_open, $country_block, $action, $social |
register.wcp |
$open, $quick, $types, $type, $country, $age, $action, $started, $honeypot, $blocks, $referral, $social, $social_pending |
password-forgot.wcp |
$mail_ready, $action |
password-reset.wcp |
$valid, $token, $email, $action, $blocks['password_html'] |
two-factor.wcp |
$kind, $method, $alternatives, $target, $code_status, $can_recover, $resend, $verify_action, $send_action |
recovery.wcp |
$done, $open, $type, $types, $action |
recovery-code.wcp |
$channel, $action |
recovery-cancel.wcp |
$state (invalid / closed / open), $status, $request (type, time), $action |
Core blocks ($blocks): parts whose rules live in the core arrive as ready HTML. The theme places and styles them with {!! $blocks['…_html'] !!} and does not rewrite their content.
password_html: password, confirmation, rule indicator and password generator.client_fields_html: identity, contact, address, date of birth and password on full registration.custom_fields_html,agreements_html,marketing_html.
Minimum age ($age)
- Values:
required,min,types,max_date. - On quick registration, when
requiredis true the theme shows aname="birth_date"field for the account types intypes. The container getsdata-for-type; when the type changes the core script hides and disables the field. - Age calculation and the registration block are on the server. A theme that hides the field cannot bypass the rule; registration is refused.
Social buttons ($social)
- Structure:
position(above/below) andbuttons(name,label,url). - Only providers that are enabled and configured in admin arrive. If the list is empty, do not draw the divider either.
- On login each button is its own form (with CSRF).
- On registration the buttons submit inside the registration form with
formactionandformnovalidate, so account type, agreement consents and date of birth are checked before going to the provider. - When
$social_pending['needs_birth_date']is true, ask the client to enter the date and press the same button.
Field names, form addresses, the honeypot field ($honeypot) and _started must not change. Captcha is drawn with site_component('captcha', ['form' => 'client.login']) (or client.register, client.password, client.recovery).
Partials (@include('includes.x')) see the page's data; the caller can also pass variables explicitly: @include('includes.logo', ['logoClass' => 'x']).