Skip to content

Commit 80c2fa8

Browse files
Mattia Vianellivins01-4science
authored andcommitted
Merged in task/dspace-cris-2023_02_x/DSC-2485 (pull request DSpace#3510)
Task/dspace cris 2023 02 x/DSC-2485 Approved-by: Francesco Molinaro
2 parents 66cdea2 + da3fc49 commit 80c2fa8

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/app/app-routing.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,14 @@ import {
184184
data: {
185185
isBackDoor: true,
186186
},
187-
canMatch: [() => environment.auth.disableStandardLogin],
187+
canMatch: [() => !environment.auth.disableStandardLogin],
188188
},
189189
{
190190
path: 'login',
191191
loadChildren: () => import('./login-page/login-page.module').then((m) => m.LoginPageModule),
192192
data: {
193193
isBackDoor: false,
194194
},
195-
canMatch: [() => !environment.auth.disableStandardLogin],
196195
},
197196
{
198197
path: 'external-login/:token',

src/app/shared/log-in/log-in.component.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('LogInComponent', () => {
127127

128128
it('should render a log-in container component for each auth method available', () => {
129129
const loginContainers = fixture.debugElement.queryAll(By.css('ds-log-in-container'));
130-
expect(loginContainers.length).toBe(2);
130+
expect(loginContainers.length).toBe(1);
131131

132132
});
133133

@@ -143,14 +143,15 @@ describe('LogInComponent', () => {
143143
expect(result).toEqual([{ authMethodType: AuthMethodType.Password, position: 1 }]);
144144
});
145145

146-
it('excludes password method when standard login is disabled', () => {
146+
it('does not exclude password method when standard login is disabled', () => {
147147
const authMethods = [
148148
{ authMethodType: AuthMethodType.Password, position: 1 },
149149
{ authMethodType: AuthMethodType.Shibboleth, position: 2 },
150150
];
151151
component.excludedAuthMethod = undefined;
152152
const result = component.filterAndSortAuthMethods(authMethods, false, true);
153153
expect(result).toEqual([
154+
{ authMethodType: AuthMethodType.Password, position: 1 },
154155
{ authMethodType: AuthMethodType.Shibboleth, position: 2 },
155156
]);
156157
});
@@ -165,8 +166,7 @@ describe('LogInComponent', () => {
165166
component.excludedAuthMethod = AuthMethodType.Ip;
166167
const result = component.filterAndSortAuthMethods(authMethods, isBackdoor);
167168
expect(result).toEqual([
168-
{ authMethodType: AuthMethodType.Password, position: 1 },
169-
{ authMethodType: AuthMethodType.Shibboleth, position: 3 },
169+
{ authMethodType: AuthMethodType.Shibboleth, position: 3 }
170170
]);
171171
});
172172

@@ -179,8 +179,7 @@ describe('LogInComponent', () => {
179179
component.excludedAuthMethod = undefined;
180180
const result = component.filterAndSortAuthMethods(authMethods, isBackdoor);
181181
expect(result).toEqual([
182-
{ authMethodType: AuthMethodType.Shibboleth, position: 1 },
183-
{ authMethodType: AuthMethodType.Password, position: 2 },
182+
{ authMethodType: AuthMethodType.Shibboleth, position: 1 }
184183
]);
185184
});
186185
});

src/app/shared/log-in/log-in.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class LogInComponent implements OnInit, OnDestroy {
132132
if (isBackdoor) {
133133
return authM.authMethodType === AuthMethodType.Password;
134134
}
135-
if (isStandardLoginDisabled) {
135+
if (!isStandardLoginDisabled) {
136136
return authM.authMethodType !== AuthMethodType.Password;
137137
}
138138
return true;

src/config/default-app-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class DefaultAppConfig implements AppConfig {
136136
// This is independent from the idle warning.
137137
timeLeftBeforeTokenRefresh: 2 * 60 * 1000 // 2 minutes
138138
},
139-
disableStandardLogin: false, // Enable the standard login form
139+
disableStandardLogin: true, // Enable the standard login form
140140
};
141141

142142
// Form settings

0 commit comments

Comments
 (0)