555
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
516 B

import { TYPE_DISPATCH } from "../../_constants/common";
const initialState = {
user: {},
jwt_token: "",
};
const authentication = (state = initialState, action) => {
switch (action.type) {
case TYPE_DISPATCH.LOGIN:
return {
...state,
user: action.payload.user,
jwt_token: action.payload.jwt_token,
};
case TYPE_DISPATCH.RESET_AUTHENTICATION:
return initialState;
default:
return state;
}
};
export { authentication };