Bug with leading slash.

Created on 30 April 2025, 17 days ago

Problem/Motivation

We removed the assumption of a leading slash from the paths.

Unfortunately, we missed a couple of places the leading slash should have been removed when this change was made.

Steps to reproduce

Set up a verify email with a destination path starting with a leading slash. Initiate a login on the verify form. Click the email link to complete. "The website encountered an unexpected error" will be displayed.

Proposed resolution

The VerifyEmailRedirectTest class sets up a Verify Email entity for testing. Unfortunately, it assumes a leading slash will be added, so doesn't contain one.

In the Verifier class, the verifyAndLogin() function concatenates the specified redirect path to internal:/. Unfortunately, if the destination path starts with a "/", this is an invalid redirect.

Remaining tasks

  • In VerifyEmailRoutingTest, add leading slash to the path and redirect_path, when setting up the the VerifyEmail entity
  • Run the test to verify now failing.
  • In Verifier::verifyAndLogin(), there are two places where 'internal:/' is used. This should be changed to 'internal:'

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇪Ireland lostcarpark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024