2016-06-24 00:29:55 +02:00
|
|
|
import * as ActionTypes from '../../constants';
|
2016-06-09 22:28:21 +02:00
|
|
|
|
2016-06-24 00:29:55 +02:00
|
|
|
const user = (state = { authenticated: false }, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case ActionTypes.AUTH_USER:
|
|
|
|
return { ...action.user,
|
|
|
|
authenticated: true };
|
|
|
|
case ActionTypes.AUTH_ERROR:
|
|
|
|
return {
|
|
|
|
authenticated: false
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|
2016-06-09 22:28:21 +02:00
|
|
|
|
2016-06-24 00:29:55 +02:00
|
|
|
export default user;
|