chore: code cleanup

This commit is contained in:
canove
2021-01-14 21:48:55 -03:00
parent af56447464
commit a5004eb425
7 changed files with 12 additions and 15 deletions

View File

@@ -84,11 +84,11 @@ const useAuth = () => {
};
}, [user]);
const handleLogin = async user => {
const handleLogin = async userData => {
setLoading(true);
try {
const { data } = await api.post("/auth/login", user);
const { data } = await api.post("/auth/login", userData);
localStorage.setItem("token", JSON.stringify(data.token));
api.defaults.headers.Authorization = `Bearer ${data.token}`;
setUser(data.user);