@dsivd/prestations-ng 18.2.4-beta.6 → 18.2.4-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -1911,7 +1911,7 @@ const isRedirectionToLogin = (event) => {
|
|
|
1911
1911
|
class IamExpiredInterceptorService {
|
|
1912
1912
|
constructor() {
|
|
1913
1913
|
this.http = inject(HttpClient);
|
|
1914
|
-
|
|
1914
|
+
// private appInfoService = inject(ApplicationInfoService);
|
|
1915
1915
|
this.sessionInfoService = inject(SessionInfo);
|
|
1916
1916
|
this._isIamSessionExpired = new BehaviorSubject(false);
|
|
1917
1917
|
}
|
|
@@ -1924,20 +1924,21 @@ class IamExpiredInterceptorService {
|
|
|
1924
1924
|
intercept(req, next) {
|
|
1925
1925
|
// Skip interceptor for the preliminary requests
|
|
1926
1926
|
if (req.headers.has('X-Skip-Interceptor') ||
|
|
1927
|
-
req.url.includes(APP_INFO_API_URL) ||
|
|
1927
|
+
// req.url.includes(APP_INFO_API_URL) ||
|
|
1928
1928
|
req.url.includes(SESSION_INFO_API_URL)) {
|
|
1929
1929
|
console.log('skipping interceptor for req : ', req);
|
|
1930
1930
|
return next.handle(req);
|
|
1931
1931
|
}
|
|
1932
|
-
const isDevEnv = this.appInfoService.data.pipe(
|
|
1933
|
-
|
|
1934
|
-
|
|
1932
|
+
// const isDevEnv = this.appInfoService.data.pipe(
|
|
1933
|
+
// map(appInfo => appInfo.environment.toUpperCase() === 'CO'),
|
|
1934
|
+
// tap(result => {
|
|
1935
|
+
// console.log('isDevEnv', result);
|
|
1936
|
+
// })
|
|
1937
|
+
// );
|
|
1935
1938
|
const isUserConnected = this.sessionInfoService.data.pipe(map(sessionInfo => !!sessionInfo?.context), tap(result => {
|
|
1936
1939
|
console.log('isUserConnected', result);
|
|
1937
1940
|
}));
|
|
1938
|
-
return combineLatest([
|
|
1939
|
-
? this.getRenewIamSession()
|
|
1940
|
-
: of(null)).pipe(switchMap(() => next.handle(req).pipe(map(event => {
|
|
1941
|
+
return combineLatest([isUserConnected]).pipe(take(1), switchMap(([isConnected]) => (isConnected ? this.getRenewIamSession() : of(null)).pipe(switchMap(() => next.handle(req).pipe(map(event => {
|
|
1941
1942
|
if (event instanceof HttpResponseBase) {
|
|
1942
1943
|
if (hasIamExpiredHeader(event) ||
|
|
1943
1944
|
isRedirectionToLogin(event)) {
|