Cosmos-Server/client/src/api/authentication.jsx

26 lines
416 B
React
Raw Normal View History

2023-03-12 18:17:28 +00:00
function login(values) {
return fetch('/cosmos/api/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(values)
})
.then((res) => res.json())
}
function me() {
return fetch('/cosmos/api/me/', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then((res) => res.json())
}
export {
login,
me
};