diff --git a/src/app/core/auth/auth.actions.ts b/src/app/core/auth/auth.actions.ts index 6b2dcc3ff9..a3e816da9e 100644 --- a/src/app/core/auth/auth.actions.ts +++ b/src/app/core/auth/auth.actions.ts @@ -355,6 +355,11 @@ export class RetrieveAuthMethodsSuccessAction implements Action { } } +/** + * Set password as default authentication method on error + * @class RetrieveAuthMethodsErrorAction + * @implements {Action} + */ export class RetrieveAuthMethodsErrorAction implements Action { public type: string = AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR; } diff --git a/src/app/core/auth/auth.reducer.spec.ts b/src/app/core/auth/auth.reducer.spec.ts index b7073e3fa5..6fdc5933fb 100644 --- a/src/app/core/auth/auth.reducer.spec.ts +++ b/src/app/core/auth/auth.reducer.spec.ts @@ -469,7 +469,7 @@ describe('authReducer', () => { authenticated: false, loaded: false, loading: false, - authMethods: [] + authMethods: [new AuthMethod(AuthMethodType.Password)] }; expect(newState).toEqual(state); }); diff --git a/src/app/core/auth/auth.reducer.ts b/src/app/core/auth/auth.reducer.ts index 7e6db94eab..29fe3d76a4 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -16,6 +16,7 @@ import { import { EPerson } from '../eperson/models/eperson.model'; import { AuthTokenInfo } from './models/auth-token-info.model'; import { AuthMethod } from './models/auth.method'; +import { AuthMethodType } from './models/auth.method-type'; /** * The auth state. @@ -199,7 +200,8 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut case AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR: return Object.assign({}, state, { - loading: false + loading: false, + authMethods: [new AuthMethod(AuthMethodType.Password)] }); case AuthActionTypes.SET_REDIRECT_URL: