Registration page: link signed-in visitors to the configured redirect page #131

Closed
opened 2026-07-29 01:44:02 +00:00 by thatguygriff · 0 comments
Owner

Problem

A signed-in visitor who lands on the registration page gets a dead end:

src/Auth/RegistrationPage.php:85

return '<p>' . esc_html__( 'You already have an account and are logged in.', 'unsupervised-schedular' ) . '</p>';

That is the whole output — a bare sentence with nowhere to go. The visitor has to find their own way to the booking/account page.

Expected

The message should offer a link onward to the page configured on the block/shortcode, the same destination an invited student is sent to.

The machinery already exists a few lines above, in the just-registered-via-invite branch (RegistrationPage.php:73-82):

$continue = $this->continueUrl( $this->successPageId( $atts ) );

successPageId() reads the block loginPageId / shortcode login_page_id attribute (:343); continueUrl() (:363) returns the permalink or null when nothing is configured or the page has since been deleted.

Requested change

In the logged-in branch, render the message plus a "Continue to your account" (or similar) link built from continueUrl( successPageId( $atts ) ).

When no page is configured — continueUrl() returns null — keep the current bare message rather than falling back to wp_login_url(). Pointing an already-signed-in visitor at the sign-in screen is the same dead end with extra steps; this is why the invite branch deliberately avoids the login fallback (see the comment at :69-72).

Consider wrapping it in the same <div class="us-register-form"> the invite branch uses so it picks up the plugin styling.

Acceptance criteria

  • Signed-in visitor + configured page → message with a working link to that page.
  • Signed-in visitor + no configured page (or a deleted one) → current message, no broken link.
  • The existing us_registered=invite success branch is unchanged.
  • Unit test coverage in tests/Unit/Auth/ for both branches.

Files

  • src/Auth/RegistrationPage.php
  • docs/features/account-registration.md
## Problem A signed-in visitor who lands on the registration page gets a dead end: `src/Auth/RegistrationPage.php:85` ```php return '<p>' . esc_html__( 'You already have an account and are logged in.', 'unsupervised-schedular' ) . '</p>'; ``` That is the whole output — a bare sentence with nowhere to go. The visitor has to find their own way to the booking/account page. ## Expected The message should offer a link onward to the page configured on the block/shortcode, the same destination an invited student is sent to. The machinery already exists a few lines above, in the just-registered-via-invite branch (`RegistrationPage.php:73-82`): ```php $continue = $this->continueUrl( $this->successPageId( $atts ) ); ``` `successPageId()` reads the block `loginPageId` / shortcode `login_page_id` attribute (`:343`); `continueUrl()` (`:363`) returns the permalink or `null` when nothing is configured or the page has since been deleted. ## Requested change In the logged-in branch, render the message plus a "Continue to your account" (or similar) link built from `continueUrl( successPageId( $atts ) )`. When no page is configured — `continueUrl()` returns `null` — keep the current bare message rather than falling back to `wp_login_url()`. Pointing an already-signed-in visitor at the sign-in screen is the same dead end with extra steps; this is why the invite branch deliberately avoids the login fallback (see the comment at `:69-72`). Consider wrapping it in the same `<div class="us-register-form">` the invite branch uses so it picks up the plugin styling. ## Acceptance criteria - Signed-in visitor + configured page → message with a working link to that page. - Signed-in visitor + no configured page (or a deleted one) → current message, no broken link. - The existing `us_registered=invite` success branch is unchanged. - Unit test coverage in `tests/Unit/Auth/` for both branches. ## Files - `src/Auth/RegistrationPage.php` - `docs/features/account-registration.md`
thatguygriff added the enhancement label 2026-07-29 01:44:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#131