Loading js-apps/frontend/src/js/app-container.js +27 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,33 @@ class AppContainer extends Component { this.meepGeoDataApi = new meepGisEngineRestApiClient.GeospatialDataApi(); this.meepMonEngineApi = new meepMonEngineRestApiClient.PodStatesApi(); // Intercept 401 Unauthorized responses to gracefully handle session expiry const addAuthInterceptor = (client) => { const instance = client.ApiClient.instance; const originalCallApi = instance.callApi.bind(instance); instance.callApi = (path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, callback) => { const wrappedCallback = (error, data, response) => { if (error && error.status === StatusCodes.UNAUTHORIZED) { if (this.props.signInStatus === STATUS_SIGNED_IN) { this.logout(); this.props.changeCurrentDialog(DIALOG_SESSION_TERMINATED); } } if (callback) { callback(error, data, response); } }; return originalCallApi(path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, wrappedCallback); }; }; addAuthInterceptor(meepAuthSvcRestApiClient); addAuthInterceptor(meepPlatformCtrlRestApiClient); addAuthInterceptor(meepSandboxCtrlRestApiClient); addAuthInterceptor(meepMetricsEngineRestApiClient); addAuthInterceptor(meepGisEngineRestApiClient); addAuthInterceptor(meepMonEngineRestApiClient); // Initialize undefined states if (this.props.terminationInProgressCount === undefined) { this.props.changeTerminationInProgressCount(-1); Loading js-apps/frontend/src/js/containers/app-container.js +27 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,33 @@ class AppContainer extends Component { this.meepGeoDataApi = new meepGisEngineRestApiClient.GeospatialDataApi(); this.meepMonEngineApi = new meepMonEngineRestApiClient.PodStatesApi(); // Intercept 401 Unauthorized responses to gracefully handle session expiry const addAuthInterceptor = (client) => { const instance = client.ApiClient.instance; const originalCallApi = instance.callApi.bind(instance); instance.callApi = (path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, callback) => { const wrappedCallback = (error, data, response) => { if (error && error.status === StatusCodes.UNAUTHORIZED) { if (this.props.signInStatus === STATUS_SIGNED_IN) { this.logout(); this.props.changeCurrentDialog(DIALOG_SESSION_TERMINATED); } } if (callback) { callback(error, data, response); } }; return originalCallApi(path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, wrappedCallback); }; }; addAuthInterceptor(meepAuthSvcRestApiClient); addAuthInterceptor(meepPlatformCtrlRestApiClient); addAuthInterceptor(meepSandboxCtrlRestApiClient); addAuthInterceptor(meepMetricsEngineRestApiClient); addAuthInterceptor(meepGisEngineRestApiClient); addAuthInterceptor(meepMonEngineRestApiClient); // Initialize undefined states if (this.props.terminationInProgressCount === undefined) { this.props.changeTerminationInProgressCount(-1); Loading Loading
js-apps/frontend/src/js/app-container.js +27 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,33 @@ class AppContainer extends Component { this.meepGeoDataApi = new meepGisEngineRestApiClient.GeospatialDataApi(); this.meepMonEngineApi = new meepMonEngineRestApiClient.PodStatesApi(); // Intercept 401 Unauthorized responses to gracefully handle session expiry const addAuthInterceptor = (client) => { const instance = client.ApiClient.instance; const originalCallApi = instance.callApi.bind(instance); instance.callApi = (path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, callback) => { const wrappedCallback = (error, data, response) => { if (error && error.status === StatusCodes.UNAUTHORIZED) { if (this.props.signInStatus === STATUS_SIGNED_IN) { this.logout(); this.props.changeCurrentDialog(DIALOG_SESSION_TERMINATED); } } if (callback) { callback(error, data, response); } }; return originalCallApi(path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, wrappedCallback); }; }; addAuthInterceptor(meepAuthSvcRestApiClient); addAuthInterceptor(meepPlatformCtrlRestApiClient); addAuthInterceptor(meepSandboxCtrlRestApiClient); addAuthInterceptor(meepMetricsEngineRestApiClient); addAuthInterceptor(meepGisEngineRestApiClient); addAuthInterceptor(meepMonEngineRestApiClient); // Initialize undefined states if (this.props.terminationInProgressCount === undefined) { this.props.changeTerminationInProgressCount(-1); Loading
js-apps/frontend/src/js/containers/app-container.js +27 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,33 @@ class AppContainer extends Component { this.meepGeoDataApi = new meepGisEngineRestApiClient.GeospatialDataApi(); this.meepMonEngineApi = new meepMonEngineRestApiClient.PodStatesApi(); // Intercept 401 Unauthorized responses to gracefully handle session expiry const addAuthInterceptor = (client) => { const instance = client.ApiClient.instance; const originalCallApi = instance.callApi.bind(instance); instance.callApi = (path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, callback) => { const wrappedCallback = (error, data, response) => { if (error && error.status === StatusCodes.UNAUTHORIZED) { if (this.props.signInStatus === STATUS_SIGNED_IN) { this.logout(); this.props.changeCurrentDialog(DIALOG_SESSION_TERMINATED); } } if (callback) { callback(error, data, response); } }; return originalCallApi(path, httpMethod, pathParams, queryParams, collectionQueryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, returnType, wrappedCallback); }; }; addAuthInterceptor(meepAuthSvcRestApiClient); addAuthInterceptor(meepPlatformCtrlRestApiClient); addAuthInterceptor(meepSandboxCtrlRestApiClient); addAuthInterceptor(meepMetricsEngineRestApiClient); addAuthInterceptor(meepGisEngineRestApiClient); addAuthInterceptor(meepMonEngineRestApiClient); // Initialize undefined states if (this.props.terminationInProgressCount === undefined) { this.props.changeTerminationInProgressCount(-1); Loading