more auth stuff

This commit is contained in:
ntr committed 2022-08-08 22:58:19 +10:00
1 parent 65e603f222
commit a8e5e5d7cd
7 files changed
+98 -53

No files matched your search

+22 -5
View File
@@ -7,9 +7,7 @@ const api = axios.create({
const actions = {
getBundles: async () => {
const res = await api.get('/bundles');
const { data: bundles } = res;
console.log(res);
const { data: bundles } = await api.get('/bundles');
return bundles;
},
@@ -23,13 +21,32 @@ const actions = {
return data;
},
getLogin: async () => {
try {
const { data: user } = await api.get('/auth/login')
console.log(user);
return user;
} catch (e) {
return null;
}
},
postLogin: async (email, password) => {
const res = await api.post('/auth/login', {
const { data } = await api.post('/auth/login', {
email,
password,
});
return res.data;
return data;
},
postRegister: async (email, password) => {
const { data } = await api.post('/auth/register', {
email,
password,
});
return data;
},
};