@openmfp/portal-ui-lib 0.194.14 → 0.194.16
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.
|
@@ -4,7 +4,7 @@ import * as i1 from '@angular/common/http';
|
|
|
4
4
|
import { HttpHeaders, HttpErrorResponse, HttpClient, provideHttpClient } from '@angular/common/http';
|
|
5
5
|
import { firstValueFrom, Subject, lastValueFrom, tap, filter } from 'rxjs';
|
|
6
6
|
import * as i1$1 from '@angular/router';
|
|
7
|
-
import { ActivatedRoute, NavigationEnd, RouterOutlet, RouteReuseStrategy, provideRouter } from '@angular/router';
|
|
7
|
+
import { ActivatedRoute, NavigationEnd, RouterOutlet, RouteReuseStrategy, UrlHandlingStrategy, provideRouter } from '@angular/router';
|
|
8
8
|
import { jwtDecode } from 'jwt-decode';
|
|
9
9
|
import isEqual from 'lodash.isequal';
|
|
10
10
|
import oAuth2 from '@luigi-project/plugin-auth-oauth2';
|
|
@@ -439,6 +439,14 @@ class SessionRefreshService {
|
|
|
439
439
|
async refresh() {
|
|
440
440
|
const isRefreshed = await this.authService.refresh();
|
|
441
441
|
if (!isRefreshed) {
|
|
442
|
+
// An empty refresh response means the server could not renew the session
|
|
443
|
+
// (the SSO session hit its idle timeout or absolute lifetime). Keeping the
|
|
444
|
+
// stale auth data leaves every later request carrying a dead token, which
|
|
445
|
+
// surfaces as unexplained 401s until the user reloads by hand. Signal the
|
|
446
|
+
// expiry - the redirect target is stored by the AUTH_EXPIRED subscriber -
|
|
447
|
+
// and drop the auth data so the frame re-authenticates.
|
|
448
|
+
this.authService.authEvent(AuthEvent.AUTH_EXPIRED);
|
|
449
|
+
this.luigiCoreService.removeAuthData();
|
|
442
450
|
return;
|
|
443
451
|
}
|
|
444
452
|
this.authService.authEvent(AuthEvent.AUTH_REFRESHED);
|
|
@@ -2698,6 +2706,24 @@ class CustomReuseStrategy {
|
|
|
2698
2706
|
}
|
|
2699
2707
|
}
|
|
2700
2708
|
|
|
2709
|
+
class PreserveQueryParamsUrlHandlingStrategy {
|
|
2710
|
+
shouldProcessUrl(url) {
|
|
2711
|
+
return true;
|
|
2712
|
+
}
|
|
2713
|
+
extract(url) {
|
|
2714
|
+
return url;
|
|
2715
|
+
}
|
|
2716
|
+
merge(newUrlPart, wholeUrl) {
|
|
2717
|
+
const routerHasNoQueryParams = !newUrlPart.queryParams ||
|
|
2718
|
+
Object.keys(newUrlPart.queryParams).length === 0;
|
|
2719
|
+
const liveParams = Object.fromEntries(new URLSearchParams(location.search));
|
|
2720
|
+
if (routerHasNoQueryParams && Object.keys(liveParams).length > 0) {
|
|
2721
|
+
newUrlPart.queryParams = liveParams;
|
|
2722
|
+
}
|
|
2723
|
+
return newUrlPart;
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2701
2727
|
function providePortal(options = {}) {
|
|
2702
2728
|
const providers = [
|
|
2703
2729
|
provideHttpClient(),
|
|
@@ -2707,6 +2733,10 @@ function providePortal(options = {}) {
|
|
|
2707
2733
|
provideLanguageServices(),
|
|
2708
2734
|
provideRouter(portalRouts),
|
|
2709
2735
|
{ provide: RouteReuseStrategy, useClass: CustomReuseStrategy },
|
|
2736
|
+
{
|
|
2737
|
+
provide: UrlHandlingStrategy,
|
|
2738
|
+
useClass: PreserveQueryParamsUrlHandlingStrategy,
|
|
2739
|
+
},
|
|
2710
2740
|
...addOptionalProviders(options),
|
|
2711
2741
|
];
|
|
2712
2742
|
return makeEnvironmentProviders(providers);
|
|
@@ -2819,5 +2849,5 @@ const addOptionalProviders = (options) => {
|
|
|
2819
2849
|
* Generated bundle index. Do not edit.
|
|
2820
2850
|
*/
|
|
2821
2851
|
|
|
2822
|
-
export { AppSwitcherConfigServiceImpl, AuthConfigService, AuthEvent, AuthService, ConfigService, CustomMessageListenersService, CustomReuseStrategy, DefaultNavigationRedirectStrategy, DefaultUserProfileConfigService, ERROR_COMPONENT_CONFIG, EntityType, EnvConfigService, GlobalContextConfigService, HEADER_BAR_CONFIG_SERVICE_INJECTION_TOKEN, HeaderBarService, I18nService, IframeService, LOCAL_CONFIGURATION_SERVICE_INJECTION_TOKEN, LUIGI_APP_SWITCHER_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_AUTH_EVENTS_CALLBACKS_SERVICE_INJECTION_TOKEN, LUIGI_BREADCRUMB_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_CUSTOM_MESSAGE_LISTENERS_INJECTION_TOKEN, LUIGI_CUSTOM_NODE_CONTEXT_PROCESSING_SERVICE_INJECTION_TOKEN, LUIGI_CUSTOM_NODE_PROCESSING_SERVICE_INJECTION_TOKEN, LUIGI_EXTENDED_GLOBAL_CONTEXT_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_GLOBAL_SEARCH_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_NODES_CUSTOM_GLOBAL_SERVICE_INJECTION_TOKEN, LUIGI_NODE_CHANGE_HOOK_SERVICE_INJECTION_TOKEN, LUIGI_ROUTING_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_STATIC_SETTINGS_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_USER_PROFILE_CONFIG_SERVICE_INJECTION_TOKEN, LocalConfigurationServiceImpl, LocalNodesService, LocalStorageKeys, LoginEventService, LoginEventType, LuigiCoreService, LuigiNodesService, NAVIGATION_REDIRECT_STRATEGY_INJECTION_TOKEN, NavHeaderService, NetworkVisibility, NodeContextProcessingServiceImpl, NodeUtilsService, PortalComponent, RequestHeadersService, RoutingConfigServiceImpl, SessionRefreshService, StaticSettingsConfigServiceImpl, THEMING_SERVICE, UserSettingsConfigService, featureToggleLocalStorage, localDevelopmentSettingsLocalStorage, matchesJMESPath, providePortal, userSettingsLocalStorage };
|
|
2852
|
+
export { AppSwitcherConfigServiceImpl, AuthConfigService, AuthEvent, AuthService, ConfigService, CustomMessageListenersService, CustomReuseStrategy, DefaultNavigationRedirectStrategy, DefaultUserProfileConfigService, ERROR_COMPONENT_CONFIG, EntityType, EnvConfigService, GlobalContextConfigService, HEADER_BAR_CONFIG_SERVICE_INJECTION_TOKEN, HeaderBarService, I18nService, IframeService, LOCAL_CONFIGURATION_SERVICE_INJECTION_TOKEN, LUIGI_APP_SWITCHER_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_AUTH_EVENTS_CALLBACKS_SERVICE_INJECTION_TOKEN, LUIGI_BREADCRUMB_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_CUSTOM_MESSAGE_LISTENERS_INJECTION_TOKEN, LUIGI_CUSTOM_NODE_CONTEXT_PROCESSING_SERVICE_INJECTION_TOKEN, LUIGI_CUSTOM_NODE_PROCESSING_SERVICE_INJECTION_TOKEN, LUIGI_EXTENDED_GLOBAL_CONTEXT_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_GLOBAL_SEARCH_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_NODES_CUSTOM_GLOBAL_SERVICE_INJECTION_TOKEN, LUIGI_NODE_CHANGE_HOOK_SERVICE_INJECTION_TOKEN, LUIGI_ROUTING_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_STATIC_SETTINGS_CONFIG_SERVICE_INJECTION_TOKEN, LUIGI_USER_PROFILE_CONFIG_SERVICE_INJECTION_TOKEN, LocalConfigurationServiceImpl, LocalNodesService, LocalStorageKeys, LoginEventService, LoginEventType, LuigiCoreService, LuigiNodesService, NAVIGATION_REDIRECT_STRATEGY_INJECTION_TOKEN, NavHeaderService, NetworkVisibility, NodeContextProcessingServiceImpl, NodeUtilsService, PortalComponent, PreserveQueryParamsUrlHandlingStrategy, RequestHeadersService, RoutingConfigServiceImpl, SessionRefreshService, StaticSettingsConfigServiceImpl, THEMING_SERVICE, UserSettingsConfigService, featureToggleLocalStorage, localDevelopmentSettingsLocalStorage, matchesJMESPath, providePortal, userSettingsLocalStorage };
|
|
2823
2853
|
//# sourceMappingURL=openmfp-portal-ui-lib.mjs.map
|