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

18 lines
365 B
JavaScript
Raw Normal View History

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