Created
October 21, 2016 15:23
-
-
Save bnhansn/8925625bfd1552c33786660e165bd6ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function authenticate() { | |
| return dispatch => api.post('/sessions/refresh') | |
| .then((response) => { | |
| setCurrentUser(dispatch, response); | |
| }) | |
| .catch(() => { | |
| localStorage.removeItem('token'); | |
| window.location = '/login'; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment