mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
29 lines
586 B
JavaScript
29 lines
586 B
JavaScript
/**
|
|
* This is the second step of the login process
|
|
* @param {*} email
|
|
* @param {*} clientPublicKey
|
|
* @returns
|
|
*/
|
|
const login2 = (email, clientProof) => {
|
|
return fetch("/api/v1/auth/login2", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify({
|
|
email: email,
|
|
clientProof,
|
|
}),
|
|
credentials: "include",
|
|
}).then((res) => {
|
|
if (res.status == 200) {
|
|
console.log("User logged in", res);
|
|
return res;
|
|
} else {
|
|
console.log("Failed to log in");
|
|
}
|
|
});
|
|
};
|
|
|
|
export default login2;
|