forked from hazza/dspace-angular
Ensure that password authentication dialog is shown even if only ldap auth method is present
(cherry picked from commit 83d86d7b68
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
64c6c19618
commit
33d2a43838
@@ -129,12 +129,24 @@ export class AuthInterceptor implements HttpInterceptor {
|
|||||||
*/
|
*/
|
||||||
private sortAuthMethods(authMethodModels: AuthMethod[]): AuthMethod[] {
|
private sortAuthMethods(authMethodModels: AuthMethod[]): AuthMethod[] {
|
||||||
const sortedAuthMethodModels: AuthMethod[] = [];
|
const sortedAuthMethodModels: AuthMethod[] = [];
|
||||||
|
let passwordAuthFound = false;
|
||||||
|
let ldapAuthFound = false;
|
||||||
|
|
||||||
authMethodModels.forEach((method) => {
|
authMethodModels.forEach((method) => {
|
||||||
if (method.authMethodType === AuthMethodType.Password) {
|
if (method.authMethodType === AuthMethodType.Password) {
|
||||||
sortedAuthMethodModels.push(method);
|
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) => {
|
authMethodModels.forEach((method) => {
|
||||||
if (method.authMethodType !== AuthMethodType.Password) {
|
if (method.authMethodType !== AuthMethodType.Password) {
|
||||||
sortedAuthMethodModels.push(method);
|
sortedAuthMethodModels.push(method);
|
||||||
|
Reference in New Issue
Block a user