summaryrefslogtreecommitdiffstats
path: root/portal-FE-os/src/app/shared/utils
diff options
context:
space:
mode:
Diffstat (limited to 'portal-FE-os/src/app/shared/utils')
-rw-r--r--portal-FE-os/src/app/shared/utils/utils.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/portal-FE-os/src/app/shared/utils/utils.js b/portal-FE-os/src/app/shared/utils/utils.js
index 3c99f4ac..95d4c686 100644
--- a/portal-FE-os/src/app/shared/utils/utils.js
+++ b/portal-FE-os/src/app/shared/utils/utils.js
@@ -1,3 +1,23 @@
+function getXSRFToken() {
+ var cookies = getCookies();
+ var XSRFToken = {
+ name:'',
+ value:''
+ };
+ //var contextRoot = getContextRoot();
+ var hasXSRFToken = false;
+ for(var name in cookies) {
+ if(name == "XSRF-TOKEN") {
+ XSRFToken.name = name;
+ XSRFToken.value = cookies[name];
+ hasXSRFToken = true;
+ }
+ }
+
+ return (hasXSRFToken==false)?null:XSRFToken;
+}
+
+
function getCookies() {
var cookies = { };
if (document.cookie && document.cookie != '') {