You are here

public function LdapHelpRedirect::redirectUrl in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_authentication/src/Controller/LdapHelpRedirect.php \Drupal\ldap_authentication\Controller\LdapHelpRedirect::redirectUrl()

Redirect.

Return value

\Drupal\Core\Routing\TrustedRedirectResponse Redirect response.

1 string reference to 'LdapHelpRedirect::redirectUrl'
ldap_authentication.routing.yml in ldap_authentication/ldap_authentication.routing.yml
ldap_authentication/ldap_authentication.routing.yml

File

ldap_authentication/src/Controller/LdapHelpRedirect.php, line 22

Class

LdapHelpRedirect
LDAP help redirect controller.

Namespace

Drupal\ldap_authentication\Controller

Code

public function redirectUrl() : TrustedRedirectResponse {
  $url = $this
    ->config('ldap_authentication.settings')
    ->get('ldapUserHelpLinkUrl');
  $cacheable_metadata = new CacheableMetadata();
  $cacheable_metadata
    ->setCacheMaxAge(0);
  $response = new TrustedRedirectResponse($url);
  $response
    ->addCacheableDependency($cacheable_metadata);
  return $response;
}