Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch(`${SERVER_URL}/api/signin`, {
- method: 'POST',
- mode: 'cors',
- body: JSON.stringify({username: email, password:password})})
- .then(response => {
- if (response.status === 200) {
- response.json().then(function (data) {
- localStorage.setItem('token', data.access_token);
- dispatch({type: AUTH_USER});
- browserHistory.push('/welcome');
- });
- }})}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement