diff --git a/apps/landing/crowd.html b/apps/landing/crowd.html index 1f7224887..4570f5725 100644 --- a/apps/landing/crowd.html +++ b/apps/landing/crowd.html @@ -227,6 +227,15 @@ <h3>Whole Slide Imaging</h3> if (userType== "Admin" || userType == "Expert"){ window.location = "./landing.html" } + + // renew token + fetch('../../auth/token/renew').then(x=>x.json()).then(x=>{ + if (x.hasOwnProperty("token")) { + console.log("renewing token", x.token) + functionTokenRenew(x.token) + } + + }).catch(e=>console.error); </script> diff --git a/apps/landing/landing.html b/apps/landing/landing.html index 3bfbd33e5..9d37f654c 100644 --- a/apps/landing/landing.html +++ b/apps/landing/landing.html @@ -141,6 +141,14 @@ <h3>Whole Slide Imaging</h3> if (userType !== "Admin"){ document.getElementById("userManage").style = "display:none;"; } + // renew token + fetch('../../auth/token/renew').then(x=>x.json()).then(x=>{ + if (x.hasOwnProperty("token")) { + console.log("renewing token", x.token) + functionTokenRenew(x.token) + } + + }).catch(e=>console.error); </script> </body> diff --git a/common/util.js b/common/util.js index 0a360aa6d..7b95fe028 100644 --- a/common/util.js +++ b/common/util.js @@ -860,6 +860,13 @@ function tokenSignOut(url) { } } +function TokenRenew(value){ + document.cookie = 'token='+value+';path=/camic_htt'; + document.cookie = 'token='+value+';path=/camic/htt'; + document.cookie = 'token='+value+';path=//camic_htt'; + document.cookie = 'token='+value+';path=//camic/htt'; +} + // alias in case I missed any function googleSignOut(url){ console.log("calling google signout, now alias to token signout");