2023-10-17 19:18:19 +02:00
|
|
|
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
|
isInitializing: true,
|
|
|
|
|
config: null,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line default-param-last
|
|
|
|
|
export default (state = initialState, { type, payload }) => {
|
|
|
|
|
switch (type) {
|
|
|
|
|
case ActionTypes.LOGIN_INITIALIZE:
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
isInitializing: false,
|
|
|
|
|
config: payload.config,
|
|
|
|
|
};
|
|
|
|
|
case ActionTypes.AUTHENTICATE__SUCCESS:
|
2023-10-19 16:05:34 +02:00
|
|
|
case ActionTypes.USING_OIDC_AUTHENTICATE__SUCCESS:
|
2023-10-17 19:18:19 +02:00
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
isInitializing: true,
|
|
|
|
|
};
|
|
|
|
|
case ActionTypes.CORE_INITIALIZE:
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
isInitializing: false,
|
|
|
|
|
...(payload.config && {
|
|
|
|
|
config: payload.config,
|
|
|
|
|
}),
|
|
|
|
|
};
|
|
|
|
|
default:
|
|
|
|
|
return state;
|
|
|
|
|
}
|
|
|
|
|
};
|