From 83d86d7b68a97b2ed2102d13a8300f91b7bd3778 Mon Sep 17 00:00:00 2001 From: Miika Nurminen Date: Tue, 28 Jan 2025 23:41:30 +0200 Subject: [PATCH 1/2] Ensure that password authentication dialog is shown even if only ldap auth method is present --- src/app/core/auth/auth.interceptor.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index 84d4c53210..d011d27059 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -129,12 +129,24 @@ export class AuthInterceptor implements HttpInterceptor { */ private sortAuthMethods(authMethodModels: AuthMethod[]): AuthMethod[] { const sortedAuthMethodModels: AuthMethod[] = []; + let passwordAuthFound = false; + let ldapAuthFound = false; + authMethodModels.forEach((method) => { if (method.authMethodType === AuthMethodType.Password) { sortedAuthMethodModels.push(method); + passwordAuthFound = true; + } + if (method.authMethodType === AuthMethodType.Ldap) { + ldapAuthFound = true; } }); + // Using password authentication method to provide UI for LDAP authentication even if password auth is not present in server + if (ldapAuthFound && !(passwordAuthFound)) { + sortedAuthMethodModels.push(new AuthMethod(AuthMethodType.Password,0)); + } + authMethodModels.forEach((method) => { if (method.authMethodType !== AuthMethodType.Password) { sortedAuthMethodModels.push(method); From 83d24f8c216aa07199973a7dc716b55b34d09a54 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 31 Jan 2025 14:28:55 -0600 Subject: [PATCH 2/2] Ensure "/reload/" (hard reload) path is included in SSR paths. --- config/config.example.yml | 4 +++- src/environments/environment.production.ts | 2 +- src/environments/environment.test.ts | 2 +- src/environments/environment.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index c6d71714ef..3efc5f5676 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -24,7 +24,9 @@ ssr: # disabled (false) by default to boost server performance at the expense of loading smoothness. inlineCriticalCss: false # Path prefixes to enable SSR for. By default these are limited to paths of primary DSpace objects. - paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/' ] + # NOTE: The "/handle/" path ensures Handle redirects work via SSR. The "/reload/" path ensures + # hard refreshes (e.g. after login) trigger SSR while fully reloading the page. + paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/', '/reload/' ] # Whether to enable rendering of Search component on SSR. # If set to true the component will be included in the HTML returned from the server side rendering. # If set to false the component will not be included in the HTML returned from the server side rendering. diff --git a/src/environments/environment.production.ts b/src/environments/environment.production.ts index 8159fff2ea..33434183cd 100644 --- a/src/environments/environment.production.ts +++ b/src/environments/environment.production.ts @@ -8,7 +8,7 @@ export const environment: Partial = { enabled: true, enablePerformanceProfiler: false, inlineCriticalCss: false, - paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/' ], + paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/', '/reload/' ], enableSearchComponent: false, enableBrowseComponent: false, }, diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 17d4e8ed10..7e967fb227 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -12,7 +12,7 @@ export const environment: BuildConfig = { enabled: true, enablePerformanceProfiler: false, inlineCriticalCss: false, - paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/' ], + paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/', '/reload/' ], enableSearchComponent: false, enableBrowseComponent: false, }, diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 4ac586d899..1f409b232f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -13,7 +13,7 @@ export const environment: Partial = { enabled: false, enablePerformanceProfiler: false, inlineCriticalCss: false, - paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/' ], + paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/', '/reload/' ], enableSearchComponent: false, enableBrowseComponent: false, },