Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const currentUser = () => (dispatch) => {
- axios.get('/users/current')
- .then((response) => {
- dispatch({
- type: actionTypes.CURRENT_USER, payload: response.data.current_user,
- });
- });
- };
- export const signIn = user => (dispatch) => {
- axios.post('/authorizations', { ...user })
- .then((response) => {
- setToken(response.data.token);
- dispatch(currentUser());
- });
- };
Add Comment
Please, Sign In to add comment