budibase/packages/client/src/api/auth.js

18 lines
353 B
JavaScript
Raw Normal View History

import API from "./api"
2020-11-11 13:25:50 +01:00
/**
* Performs a log in request.
*/
2020-12-04 13:22:45 +01:00
export const logIn = async ({ email, password }) => {
if (!email) {
return API.error("Please enter your email")
2020-11-11 13:25:50 +01:00
}
if (!password) {
return API.error("Please enter your password")
2020-11-11 13:25:50 +01:00
}
return await API.post({
2020-11-11 13:25:50 +01:00
url: "/api/authenticate",
2020-12-04 13:22:45 +01:00
body: { email, password },
2020-11-11 13:25:50 +01:00
})
}