mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
Set password as default authentication method on error
This commit is contained in:
@@ -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 {
|
export class RetrieveAuthMethodsErrorAction implements Action {
|
||||||
public type: string = AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR;
|
public type: string = AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR;
|
||||||
}
|
}
|
||||||
|
@@ -469,7 +469,7 @@ describe('authReducer', () => {
|
|||||||
authenticated: false,
|
authenticated: false,
|
||||||
loaded: false,
|
loaded: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
authMethods: []
|
authMethods: [new AuthMethod(AuthMethodType.Password)]
|
||||||
};
|
};
|
||||||
expect(newState).toEqual(state);
|
expect(newState).toEqual(state);
|
||||||
});
|
});
|
||||||
|
@@ -16,6 +16,7 @@ import {
|
|||||||
import { EPerson } from '../eperson/models/eperson.model';
|
import { EPerson } from '../eperson/models/eperson.model';
|
||||||
import { AuthTokenInfo } from './models/auth-token-info.model';
|
import { AuthTokenInfo } from './models/auth-token-info.model';
|
||||||
import { AuthMethod } from './models/auth.method';
|
import { AuthMethod } from './models/auth.method';
|
||||||
|
import { AuthMethodType } from './models/auth.method-type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The auth state.
|
* The auth state.
|
||||||
@@ -199,7 +200,8 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut
|
|||||||
|
|
||||||
case AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR:
|
case AuthActionTypes.RETRIEVE_AUTH_METHODS_ERROR:
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
loading: false
|
loading: false,
|
||||||
|
authMethods: [new AuthMethod(AuthMethodType.Password)]
|
||||||
});
|
});
|
||||||
|
|
||||||
case AuthActionTypes.SET_REDIRECT_URL:
|
case AuthActionTypes.SET_REDIRECT_URL:
|
||||||
|
Reference in New Issue
Block a user