File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 11{
22 "API_BASE_URL" : " " ,
3+ "API_WITH_CREDENTIALS" : false ,
34 "OIDC_ISSUER" : " " ,
45 "OIDC_CLIENT_ID" : " " ,
56 "OIDC_SCOPE" : " openid email profile" ,
Original file line number Diff line number Diff line change 3838
3939 setJwtForAjax (getToken ());
4040
41+ // Enable credentialed cross-site Access-Control requests
42+ if (this .$api .WITH_CREDENTIALS ){
43+ this .axios .interceptors .request .use (
44+ function (config ) {
45+ config .withCredentials = true ;
46+ return config;
47+ }
48+ );
49+ }
50+
4151 // debug logging of ajax requests/responses
4252 if (getUrlVar (' debug' )) {
4353 $ (document ).ajaxComplete ((event , xhr ) => {
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ axios.get(contextPath + "/static/config.json").then(response => {
4444 } else {
4545 Vue . prototype . $api . BASE_URL = contextPath ;
4646 }
47+
48+ // XHR cross-site cookie credentials
49+ Vue . prototype . $api . WITH_CREDENTIALS = response . data . API_WITH_CREDENTIALS ;
50+
4751 // OpenID Connect
4852 Vue . prototype . $oidc . ISSUER = response . data . OIDC_ISSUER ;
4953 Vue . prototype . $oidc . CLIENT_ID = response . data . OIDC_CLIENT_ID ;
You can’t perform that action at this time.
0 commit comments