From 71e4a21244a29c5f963eb2c1baf5fbe44461fe8e Mon Sep 17 00:00:00 2001 From: Zerihun Tegegn Date: Wed, 20 May 2026 09:48:31 -0400 Subject: [PATCH 1/2] WEBCMS-294 fix issue when modifying destination parameter in hook_user_login without bubbling cacheability metadata --- .../drupal/web/modules/custom/f1_sso/f1_sso.module | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/services/drupal/web/modules/custom/f1_sso/f1_sso.module b/services/drupal/web/modules/custom/f1_sso/f1_sso.module index a9804506be..a1b56a17a7 100644 --- a/services/drupal/web/modules/custom/f1_sso/f1_sso.module +++ b/services/drupal/web/modules/custom/f1_sso/f1_sso.module @@ -20,7 +20,18 @@ function f1_sso_user_login($account) { // Only overwrite destination if we don't already have one set. if (empty(\Drupal::service('request_stack')->getCurrentRequest()->query->get('destination'))) { - \Drupal::service('request_stack')->getCurrentRequest()->query->set('destination', '/admin/content/my-web-areas'); + $url = \Drupal\Core\Url::fromUserInput('/admin/content/my-web-areas'); + $generatedUrl = $url->toString(TRUE); + + $cacheability = new Drupal\Core\Cache\CacheableMetadata(); + $cacheability->setCacheContexts(['user.roles', 'url.query_args']); + + $response = new Drupal\Core\Routing\TrustedRedirectResponse($generatedUrl->getGeneratedUrl()); + $response->addCacheableDependency($cacheability); + + + \Drupal::request()->query->set('destination', $generatedUrl->getGeneratedUrl()); + \Drupal::service('request_stack')->getCurrentRequest()->attributes->set('_redirect', $response); } } From 627229da7338308b8f7b80e58ea20202f104c9d5 Mon Sep 17 00:00:00 2001 From: Zerihun Tegegn Date: Wed, 20 May 2026 10:31:39 -0400 Subject: [PATCH 2/2] WEBCMS-294 fix issue when modifying destination parameter in hook_user_login without bubbling cacheability metadata --- services/drupal/web/modules/custom/f1_sso/f1_sso.module | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/drupal/web/modules/custom/f1_sso/f1_sso.module b/services/drupal/web/modules/custom/f1_sso/f1_sso.module index a1b56a17a7..ea4f8c3185 100644 --- a/services/drupal/web/modules/custom/f1_sso/f1_sso.module +++ b/services/drupal/web/modules/custom/f1_sso/f1_sso.module @@ -21,6 +21,8 @@ function f1_sso_user_login($account) { // Only overwrite destination if we don't already have one set. if (empty(\Drupal::service('request_stack')->getCurrentRequest()->query->get('destination'))) { $url = \Drupal\Core\Url::fromUserInput('/admin/content/my-web-areas'); + + //Generate absolute URL, setting to TRUE collect bubbleable metadata $generatedUrl = $url->toString(TRUE); $cacheability = new Drupal\Core\Cache\CacheableMetadata();