install and handle casle & prevent page dashboard & handle register and code verfication & get data in clinics page

This commit is contained in:
Ehsan
2025-05-27 03:40:06 +03:30
parent a9f98aea3b
commit d95815d4aa
27 changed files with 336 additions and 206 deletions
+8 -7
View File
@@ -1,30 +1,31 @@
import api from "./api";
export const request = {
sendCode: (mobile_number) =>
sendCode: (mobile, captcha_token) =>
api.post(
"api/v1/user/auth",
{ mobile_number },
"api/v1/user/send-code",
{
mobile,
captcha_token,
},
{
headers: {
Authorization: "",
withCredentials: true,
},
}
),
getToken: (grant_type, client_id, client_secret, mobile_number, code) => {
getToken: (grant_type, client_id, client_secret, uuid, code) => {
const formData = new URLSearchParams();
formData.append("grant_type", grant_type);
formData.append("client_id", client_id);
formData.append("client_secret", client_secret);
formData.append("mobile_number", mobile_number);
formData.append("uuid", uuid);
formData.append("code", code);
return api.post("oauth/token", formData, {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "",
withCredentials: true,
},
});
},