diff options
author | 2020-03-31 15:36:48 -0400 | |
---|---|---|
committer | 2020-03-31 15:38:26 -0400 | |
commit | c97140ca11335db9b856c44044c9f5a07f74145a (patch) | |
tree | 3a5cd8baf9f1a2786492b2059a041bab9c1b50dc /portal-FE-os/src/app/shared/utils/utils.js | |
parent | 70aa24130b5dfa987e079a68ea350ddcb5c66dc9 (diff) |
POST calls failing due to CXRF
Issue-ID: PORTAL-870
Change-Id: Ia3fe5b27278d029a96a3e20ec62cfecb1b92a52b
Signed-off-by: statta <statta@research.att.com>
Diffstat (limited to 'portal-FE-os/src/app/shared/utils/utils.js')
-rw-r--r-- | portal-FE-os/src/app/shared/utils/utils.js | 20 |
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 != '') { |