export const login = user => {
    return fetch("users/login", {
        method: 'POST',
        body: JSON.stringify({
            email: user.email,
            password: user.password
        }),
        headers : {'Content-type':'application/json','Authorization':'Bearer'+user.token}
    }).then(response =>{
        console.log("hjhsfdgsdhgfsdggd"+response.formData.token)
        // On below line it thorws an exception
        window.localStorage.setItem('usertoken',response.formData.token)
        return response.formData.token
    }).catch(err =>{
        console.log(err);
    })
}
The highlighted code throws the error:
SyntaxError: Unexpected token export on debugging
and while viewing in the local storage the key comes as undefined
I am using jwt for token authentication
 
    