diff --git a/CHANGELOG.md b/CHANGELOG.md index 31cf96a..515e7fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ each change under the current top section as you work. ### Fixed - A student's **upcoming lessons no longer pile on top of each other**. On the booking page, the lesson name, its date and time, the status badge and the **Cancel** button could render over one another instead of sitting in a tidy row — worst with a long lesson-type name, and on narrow screens, where the row had no phone layout at all. The panel now keeps its shape whatever the theme around it does, long names wrap instead of shoving the Cancel button out of the row, and on a phone the lesson details stack above the buttons. +- The registration page **no longer dead-ends a visitor who is already signed in**. It used to greet them with "You already have an account and are logged in." and nothing else, leaving them to find their own way to the studio. They now get a link onward to the page chosen under the block's **After registration** panel, and the link names it — "Continue to Book a Lesson" rather than the vaguer wording an invited student used to see. With no page chosen, the message appears on its own as before, because sending someone who is already signed in to the sign-in screen helps nobody. ## [1.2.3] diff --git a/docs/features/account-registration.md b/docs/features/account-registration.md index 4e20698..96edd27 100644 --- a/docs/features/account-registration.md +++ b/docs/features/account-registration.md @@ -132,7 +132,7 @@ recorded in `us_policy_acceptances` with `registration_type = account` and The block's **After registration** panel picks the page a student continues to once registration finishes, and whether they get there by hand or automatically. -- **Sign-in page** (`loginPageId` / `login_page_id`) — the target of the "Sign in to your account" link shown after email confirmation (`?us_confirmed=1|ready`, falling back to the WordPress login screen) and of the "Continue to your account" link an invited student sees on the spot (`?us_registered=invite`; no link at all with no page chosen, since an already-signed-in student has no use for the login screen). +- **Sign-in page** (`loginPageId` / `login_page_id`) — the target of the "Sign in to your account" link shown after email confirmation (`?us_confirmed=1|ready`, falling back to the WordPress login screen) and of the **"Continue to _<page title>_"** link every **logged-in** visitor gets (`RegistrationPage::continueLink()`): an invited student who just finished signing up (`?us_registered=invite`), and anyone who simply arrives at the registration page already signed in. The link names the chosen page (via `get_the_title()`) so the visitor knows where it goes; an untitled page falls back to "Continue to your account" rather than reading "Continue to ". Neither gets the WordPress-login-screen fallback — with no page chosen there is no link at all, since sending someone already signed in to the login screen is the same dead end with extra steps. - **Redirect automatically** (`autoRedirect`, block only) — sends the student to that page instead of showing the link, via `BlockRegistrar::maybeAutoRedirect()` on `template_redirect`. It fires only on those two finished states (`RegistrationPage::isRegistrationComplete()`), so the "check your email" step, a validation error, and an `expired` confirmation link are always shown rather than redirected past. With no page chosen nothing happens — there is deliberately no login-screen fallback for the redirect. See `editor-blocks.md`. ## Token Redirect diff --git a/src/Auth/RegistrationPage.php b/src/Auth/RegistrationPage.php index 831de7e..87c0278 100644 --- a/src/Auth/RegistrationPage.php +++ b/src/Auth/RegistrationPage.php @@ -65,24 +65,21 @@ class RegistrationPage { $registered = sanitize_key( Val::string( wp_unslash( $_GET['us_registered'] ?? '' ) ) ); if ( is_user_logged_in() ) { - if ( self::RESULT_INVITE === $registered ) { - // An invited student is done the moment they land here logged in, - // so this is where their "continue" link belongs. The sign-in-page - // fallback is deliberately not used: pointing someone who is - // already signed in at the login screen helps nobody. - $continue = $this->continueUrl( $this->successPageId( $atts ) ); - $link = null === $continue - ? '' - : '
' - . esc_html__( 'Continue to your account', 'unsupervised-schedular' ) - . '
'; + // Both logged-in outcomes are dead ends without somewhere to go next, + // so both offer the same "continue" link to the configured page. + wp_enqueue_style( 'us-scheduler' ); + $link = $this->continueLink( $atts ); + if ( self::RESULT_INVITE === $registered ) { + // An invited student is done the moment they land here logged in. return '' . esc_html__( 'Your account has been created and you are now logged in.', 'unsupervised-schedular' ) . '
' . $link . '' . esc_html__( 'You already have an account and are logged in.', 'unsupervised-schedular' ) . '
'; + return '' + . esc_html__( 'You already have an account and are logged in.', 'unsupervised-schedular' ) + . '
' . $link . '