developed initial version of new login page

This commit is contained in:
Sheen Capadngan
2023-04-27 23:10:27 +08:00
parent 2dd1570200
commit dfb84e9932
7 changed files with 239 additions and 44 deletions
+6 -5
View File
@@ -9,16 +9,17 @@ interface Login1 {
* @param {*} clientPublicKey
* @returns
*/
const login1 = async (email: string, clientPublicKey: string) => {
const login1 = async (loginDetails: {
email: string;
clientPublicKey: string;
userId?: string;
}) => {
const response = await fetch("/api/v2/auth/login1", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
email,
clientPublicKey,
}),
body: JSON.stringify(loginDetails),
});
// need precise error handling about the status code
if (response?.status === 200) {
+6 -5
View File
@@ -17,16 +17,17 @@ interface Login2Response {
* @param {*} clientPublicKey
* @returns
*/
const login2 = async (email: string, clientProof: string) => {
const login2 = async (loginDetails: {
email: string;
clientProof: string;
userId?: string;
}) => {
const response = await fetch('/api/v2/auth/login2', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email,
clientProof
}),
body: JSON.stringify(loginDetails),
credentials: 'include'
});
// need precise error handling about the status code