enduserLoginAction.js
1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import axios from "axios";
import qs from "qs";
export const finishEndUserOtpLogin = async ({ mobileNumber, emailAddress, oneTimePassword }) => {
// 1. invoke the api to start the login with otp process.
const config = {
headers: {
"Content-Type": "application/json"
}
};
return await axios.post(
`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/users-permissions/users/end-user/finish-otp-login`,
{
mobileNumber,
emailAddress,
oneTimePassword
},
config
);
};
export const startEndUserOtpLogin = async ({ mobileNumber, emailAddress }) => {
// 1. invoke the api to start the login with otp process.
const config = {
headers: {
"Content-Type": "application/json"
}
};
const startOtpLoginResponse = await axios.post(
`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/users-permissions/users/end-user/start-otp-login`,
{
mobileNumber,
emailAddress
},
config
);
return startOtpLoginResponse;
};