The redirect url is wrong due to removal of leading slash from destination url

Created on 3 July 2025, 8 days ago

Problem/Motivation

To use the destination query param in the login url , so that it redirects to destination url properly post login

Steps to reproduce

  1. Use hook form alter to override the user login form
  2. Retrieve destination key from query parameter and insert this as a query parameter to Login link. For example. https://[yoursite.com]/moLogin?destination=/node/1
  3. Open the site in new window and click the sso login link
  4. This redirects to page not found as the link is removing the leading slash from the module. If we take the example link from the prior step, it redirects to https://[yoursite.com]node/1

Proposed resolution

Add trailing slash in the $base_url variable in this function miniorange_oauth_client_form_user_login_form_alter
You can use the below patch to solve this issue
https://www.drupal.org/files/issues/2025-07-03/add_trailing_slash_to_bas... →

šŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

šŸ‡®šŸ‡³India Revathidinesh

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024