Show a sign-in link instead of the registration form after email confirmation #68

Merged
thatguygriff merged 1 commits from feature/confirmed-signin-link into main 2026-07-18 21:00:23 +00:00
Owner

Closes #67

What & why

After a self-signup student clicks their confirmation email link, the registration page showed the "email confirmed, awaiting approval" message with the full registration form still rendered underneath — useless at that point (re-submitting would fail with "an account already exists") and confusing about what to do next. The page now shows only the confirmation message plus a "Sign in to your account" link. A confirmed-but-unapproved student can already log in — the pending gate only withholds booking — so signing in is the natural next step; they'll see the "awaiting approval" screen on the booking page until approved.

How it works

  • templates/frontend/register-page.php — the us_confirmed=1 case moves up to the top-level branch chain, so it renders the message + sign-in link and never falls through to the form. The expired notice keeps the form as before (that visitor may be following a stale link or need to contact the studio).
  • Auth\RegistrationPage computes the link target. There is no stored login-page setting, so this follows Booking\BookingPage's existing pattern: a loginPageId block attribute / login_page_id shortcode attribute ([us_student_register login_page_id="…"]), falling back to wp_login_url() — the same fallback the approval email uses.
  • The Student Registration block gains an "After email confirmation" inspector panel with the same page picker the booking block uses (assets/js/blocks.js), and the attribute is declared server-side in BlockRegistrar so the editor preview accepts it.

Tests

Four new render-level tests in RegistrationPageTest (confirmed → link shown and no form; configured sign-in page used; normal render still shows the form; expired still shows the form), plus the updated attribute-schema assertion in BlockRegistrarTest.

  • composer test — 365 tests pass
  • composer lint — PHPStan level 10 clean
  • composer cs — PHPCS clean

Docs updated: docs/features/account-registration.md, docs/features/editor-blocks.md.

🤖 Generated with Claude Code

Closes #67 ## What & why After a self-signup student clicks their confirmation email link, the registration page showed the "email confirmed, awaiting approval" message with the full registration form still rendered underneath — useless at that point (re-submitting would fail with "an account already exists") and confusing about what to do next. The page now shows only the confirmation message plus a **"Sign in to your account"** link. A confirmed-but-unapproved student can already log in — the pending gate only withholds booking — so signing in is the natural next step; they'll see the "awaiting approval" screen on the booking page until approved. ## How it works - `templates/frontend/register-page.php` — the `us_confirmed=1` case moves up to the top-level branch chain, so it renders the message + sign-in link and never falls through to the form. The `expired` notice keeps the form as before (that visitor may be following a stale link or need to contact the studio). - `Auth\RegistrationPage` computes the link target. There is no stored login-page setting, so this follows `Booking\BookingPage`'s existing pattern: a `loginPageId` block attribute / `login_page_id` shortcode attribute (`[us_student_register login_page_id="…"]`), falling back to `wp_login_url()` — the same fallback the approval email uses. - The Student Registration block gains an "After email confirmation" inspector panel with the same page picker the booking block uses (`assets/js/blocks.js`), and the attribute is declared server-side in `BlockRegistrar` so the editor preview accepts it. ## Tests Four new render-level tests in `RegistrationPageTest` (confirmed → link shown and no form; configured sign-in page used; normal render still shows the form; expired still shows the form), plus the updated attribute-schema assertion in `BlockRegistrarTest`. - `composer test` — 365 tests pass - `composer lint` — PHPStan level 10 clean - `composer cs` — PHPCS clean Docs updated: `docs/features/account-registration.md`, `docs/features/editor-blocks.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thatguygriff added 1 commit 2026-07-18 20:54:30 +00:00
Show a sign-in link instead of the form after email confirmation
CI / Tests (PHP 8.2) (pull_request) Successful in 41s
CI / Tests (PHP 8.1) (pull_request) Successful in 46s
CI / No Debug Code (pull_request) Successful in 2s
CI / PHPStan (pull_request) Successful in 2m45s
CI / Coding Standards (pull_request) Successful in 2m55s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m35s
CI / Build Plugin Zip (pull_request) Skipped
7b00811133
Closes #67

When a student lands on the registration page from the confirmation
email (?us_confirmed=1), replace the registration form with the
confirmation message and a "Sign in to your account" link — the form
is useless at that point and re-submitting would only produce an
"account already exists" error. A confirmed-but-unapproved student can
already log in (the pending gate only withholds booking), so signing in
is the natural next step.

The link target follows the booking block's pattern: a loginPageId
block attribute (page picker in the editor sidebar) or login_page_id
shortcode attribute, falling back to wp_login_url(). The expired-link
notice keeps the form as before.

Co-Authored-By: Claude Fable 5 <[email protected]>
thatguygriff merged commit ca2607e5ec into main 2026-07-18 21:00:23 +00:00
thatguygriff deleted branch feature/confirmed-signin-link 2026-07-18 21:00:23 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#68