actions/account.js
export const logIn = async (credentials) => {
try{
const res = await api.logIn(credentials);
document.cookie= `token=${res.data.token}`;
console.log('actions.account.logIn ->',res);
}
catch (err) {
console.log('err ->',err); // undefined , this is the part that has my head scratching, as I would expected to be at least something i.e Promise, object
return 'ERROR:Unable to process your request.';
}