Skip to content

Instantly share code, notes, and snippets.

@adrianodias8
Last active July 13, 2020 15:40
Show Gist options
  • Select an option

  • Save adrianodias8/5c5e77eab772bf46fcc940ddeecedc6b to your computer and use it in GitHub Desktop.

Select an option

Save adrianodias8/5c5e77eab772bf46fcc940ddeecedc6b to your computer and use it in GitHub Desktop.
diff --git a/cas.tokens.inc b/cas.tokens.inc
index 97aea2b..b0eb797 100644
--- a/cas.tokens.inc
+++ b/cas.tokens.inc
@@ -29,6 +29,10 @@ function cas_token_info() {
'name' => t('Login URL'),
'description' => t('The CAS login URL.'),
],
+ 'login-url-absolute' => [
+ 'name' => t('Login URL (absolute)'),
+ 'description' => t('The CAS login URL.'),
+ ],
],
],
];
@@ -59,6 +63,9 @@ function cas_tokens($type, $tokens, array $data, array $options, BubbleableMetad
case 'login-url':
$replacements[$original] = Url::fromRoute('cas.login')->toString();
break;
+ case 'login-url-absolute':
+ $replacements[$original] = Url::fromRoute('cas.login', [], ['absolute' => TRUE])->toString();
+ break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment