Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
compileUrl: function(config, url, fillSessionId) {
// Acquire cookie values.
var cstlUrl = $cookieStore.get(CstlConfig['cookie.cstl.url']),
domainId = $cookieStore.get(CstlConfig['cookie.domain.id']),
userId = $cookieStore.get(CstlConfig['cookie.user.id']);
// Inject cstl-service webapp url.
if (angular.isDefined(cstlUrl)) {
url = url.replace(CstlConfig['inject.expr.ctrl.url'], cstlUrl);
if(config){
config.headers.access_token = $.cookie(CstlConfig['cookie.auth.token']);
}
}else if (/@cstl/.test(url)){
window.location.href="index.html";
}
// Inject domain id value.
if (angular.isDefined(domainId)) {
url = url.replace(CstlConfig['inject.expr.domain.id'], domainId);
}
// Inject user id value.
if (angular.isDefined(userId)) {
url = url.replace(CstlConfig['inject.expr.user.id'], userId);
}
url = url.replace(';jsessionid=', ''); // remove it if no session
get : function(){
console.log("TokenService.get: " + $.cookie(CstlConfig['cookie.auth.token']));
return $.cookie(CstlConfig['cookie.auth.token']);
},
renew: function() {
get : function(){
console.log("TokenService.get: " + $.cookie(CstlConfig['cookie.auth.token']));
return $.cookie(CstlConfig['cookie.auth.token']);
},
renew: function() {