Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion services/drupal/web/modules/custom/f1_sso/f1_sso.module
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ 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');

//Generate absolute URL, setting to TRUE collect bubbleable metadata
$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);
}

}