File tree Expand file tree Collapse file tree 5 files changed +18
-0
lines changed Expand file tree Collapse file tree 5 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ if mount | grep '/static/config.json'; then
88else
99 # Apply ENV vars to temporary config.json
1010 jq ' .API_BASE_URL = env.API_BASE_URL
11+ | .API_WITH_CREDENTIALS = env.API_WITH_CREDENTIALS
1112 | .OIDC_ISSUER = env.OIDC_ISSUER
1213 | .OIDC_CLIENT_ID = env.OIDC_CLIENT_ID
1314 | .OIDC_SCOPE = env.OIDC_SCOPE
Original file line number Diff line number Diff line change 11{
22 "API_BASE_URL" : " " ,
3+ "API_WITH_CREDENTIALS" : " " ,
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+ // Send XHR cross-site cookie credentials
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+ $ .ajaxSettings .xhrFields = { withCredentials: true };
50+ }
51+
4152 // debug logging of ajax requests/responses
4253 if (getUrlVar (' debug' )) {
4354 $ (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+ // Send XHR cross-site cookie credentials
49+ Vue . prototype . $api . WITH_CREDENTIALS = response . data . API_WITH_CREDENTIALS && response . data . API_WITH_CREDENTIALS . toLowerCase ( ) === "true" ;
50+
4751 // OpenID Connect
4852 Vue . prototype . $oidc . ISSUER = response . data . OIDC_ISSUER ;
4953 Vue . prototype . $oidc . CLIENT_ID = response . data . OIDC_CLIENT_ID ;
Original file line number Diff line number Diff line change 99 "METHOD_PUT" : " PUT" ,
1010 "METHOD_DELETE" : " DELETE" ,
1111 "FORCE_PASSWORD_CHANGE" : " FORCE_PASSWORD_CHANGE" ,
12+ "WITH_CREDENTIALS" : " " ,
1213
1314 "BASE_URL" : " " ,
1415 "URL_ABOUT" : " api/version" ,
You can’t perform that action at this time.
0 commit comments