diff --git a/.env b/.env index e73dab8..016f2eb 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ # VITE_API_URL='https://ssa.betadelivery.com/testing/apia/v1' VITE_API_URL='https://ssa.betadelivery.com/apia/v1' VITE_USER_NAME="Admin" -# VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&" -VITE_PASSWORD="71%@L%es^bUX94`J9XT*%4&^%tUU^%Q^ffgt" +VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&" +# VITE_PASSWORD="71%@L%es^bUX94`J9XT*%4&^%tUU^%Q^ffgt" VITE_APP_NAME=MyViteApp VITE_IMG_TEMPLATES='https://ssa.betadelivery.com/storage/app/public/uploads/post_templates/' \ No newline at end of file diff --git a/.env.testing b/.env.testing index 7e0b93a..03891f6 100644 --- a/.env.testing +++ b/.env.testing @@ -1,5 +1,5 @@ -VITE_API_URL='https://ssa.betadelivery.com/testing/apia/' -VITE_USER_NAME="Admin" -VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&" -VITE_APP_NAME=MyViteApp -VITE_IMG_TEMPLATES='https://ssa.betadelivery.com/storage/app/public/uploads/post_templates/' +# VITE_API_URL='https://ssa.betadelivery.com/testing/apia/' +# VITE_USER_NAME="Admin" +# VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&" +# VITE_APP_NAME=MyViteApp +# VITE_IMG_TEMPLATES='https://ssa.betadelivery.com/storage/app/public/uploads/post_templates/' diff --git a/dev-dist/sw.js b/dev-dist/sw.js index 8da00cf..69b4925 100644 --- a/dev-dist/sw.js +++ b/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.7aakaijcn38" + "revision": "0.4sre1e6vpfo" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/src/Pages/ForgotPassword.tsx b/src/Pages/ForgotPassword.tsx index 0a3233d..449da3e 100644 --- a/src/Pages/ForgotPassword.tsx +++ b/src/Pages/ForgotPassword.tsx @@ -31,6 +31,10 @@ const ForgotPassword = () => { } = useForm(); const onSubmit = handleSubmit(async (data) => { + const username = import.meta.env.VITE_USER_NAME || ""; // Replace with actual username + const password = import.meta.env.VITE_PASSWORD || ""; // Replace with actual password + const basicAuth = `${username}:${password}`; // Encode to Base64 + setIsLoading(true); try { const res = await axios.post( @@ -38,12 +42,24 @@ const ForgotPassword = () => { { mobile_number: Number(data.mobileNumber), }, + { + headers: { + Authorization: `Basic ${basicAuth}`, + "Content-Type": "application/json", + }, + } ); if (res.status === 200) { navigate(`/forgot-password/verify?phone=${data.mobileNumber}`) } else { - alert(res.data.message || "Something went wrong"); + // alert(res.data.message || "Something went wrong"); + toaster.create({ + // title: error?.response?.data?.message, + title: res.data.message || "Something went wrong", + type: "error", + }) + setIsLoading(false); } console.log("============", res); diff --git a/src/Pages/Login.tsx b/src/Pages/Login.tsx index 7b9077f..a023088 100644 --- a/src/Pages/Login.tsx +++ b/src/Pages/Login.tsx @@ -46,8 +46,7 @@ const Login = () => { // Encode Basic Auth Credentials const username = import.meta.env.VITE_USER_NAME || ""; // Replace with actual username const password = import.meta.env.VITE_PASSWORD || ""; // Replace with actual password - const credentials = `${username}:${password}`; // Encode to Base64 - const basicAuth = btoa(credentials); // Use btoa for Base64 encoding + const basicAuth = `${username}:${password}`; // Encode to Base64 try { const res = await axios.post( diff --git a/src/Pages/ManageCMS/FAQ/EditDetails.tsx b/src/Pages/ManageCMS/FAQ/EditDetails.tsx index 18d0c08..2864c95 100644 --- a/src/Pages/ManageCMS/FAQ/EditDetails.tsx +++ b/src/Pages/ManageCMS/FAQ/EditDetails.tsx @@ -1,85 +1,3 @@ -// import { Button } from "../../../components/ui/button"; -// import { -// DialogBody, -// DialogCloseTrigger, -// DialogContent, -// DialogFooter, -// DialogHeader, -// DialogRoot, -// DialogTitle, -// DialogTrigger, -// } from "../../../components/ui/dialog"; -// import { Field, Input, Stack, Textarea } from "@chakra-ui/react"; -// import Edit from "../../../components/ActionIcons/Edit"; -// function EditDetails() { -// return ( -// -// -// {/* */} -// - -// - -// -// -// -// Edit Details -// -// - -// -// -// -// -// Questions -// -// - -// -// Answer -// -//