gorgot password deploy
This commit is contained in:
parent
64c927f27b
commit
10de1de3c2
@ -13,8 +13,8 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "The CoreUI Team (https://github.com/orgs/coreui/people)",
|
"author": "The CoreUI Team (https://github.com/orgs/coreui/people)",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "react-scripts start",
|
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-scripts start",
|
||||||
"build": "react-scripts --openssl-legacy-provider build",
|
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-scripts build",
|
||||||
"changelog": "auto-changelog --starting-version 4.1.0 --commit-limit false --hide-credit",
|
"changelog": "auto-changelog --starting-version 4.1.0 --commit-limit false --hide-credit",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject",
|
||||||
"lint": "eslint \"src/**/*.js\"",
|
"lint": "eslint \"src/**/*.js\"",
|
||||||
@ -24,7 +24,8 @@
|
|||||||
"test:cov": "npm test -- --coverage --watchAll=false",
|
"test:cov": "npm test -- --coverage --watchAll=false",
|
||||||
"test:debug": "react-scripts --inspect-brk test --runInBand",
|
"test:debug": "react-scripts --inspect-brk test --runInBand",
|
||||||
"heroku-postbuild": "npm run build"
|
"heroku-postbuild": "npm run build"
|
||||||
},
|
}
|
||||||
|
,
|
||||||
"config": {
|
"config": {
|
||||||
"coreui_library_short_version": "4.1"
|
"coreui_library_short_version": "4.1"
|
||||||
},
|
},
|
||||||
@ -86,6 +87,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"auto-changelog": "~2.3.0",
|
"auto-changelog": "~2.3.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"fuse.js": "^6.6.2",
|
"fuse.js": "^6.6.2",
|
||||||
"react-scripts": "^4.0.3",
|
"react-scripts": "^4.0.3",
|
||||||
"sass": "^1.43.5"
|
"sass": "^1.43.5"
|
||||||
|
@ -199,6 +199,7 @@ import { isAutheticated } from "./auth";
|
|||||||
import "./scss/style.scss";
|
import "./scss/style.scss";
|
||||||
import ProtectedRoute from "./components/ProtectedRoute";
|
import ProtectedRoute from "./components/ProtectedRoute";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import ForgotPassword from "./views/pages/register/ForgotPassword";
|
||||||
// Containers
|
// Containers
|
||||||
const DefaultLayout = React.lazy(() => import("./layout/DefaultLayout"));
|
const DefaultLayout = React.lazy(() => import("./layout/DefaultLayout"));
|
||||||
|
|
||||||
@ -254,6 +255,8 @@ const App = () => {
|
|||||||
<Routes>
|
<Routes>
|
||||||
{/* <Route exact path="/change-password" name="My profile" element={<ChangePassword />} /> */}
|
{/* <Route exact path="/change-password" name="My profile" element={<ChangePassword />} /> */}
|
||||||
<Route exact path="/" name="Login Page" element={<Login />} />
|
<Route exact path="/" name="Login Page" element={<Login />} />
|
||||||
|
<Route exact path="/forgot/password" name="Login Page" element={<ForgotPassword />} />
|
||||||
|
|
||||||
<Route exact path="/404" name="Page 404" element={<Page404 />} />
|
<Route exact path="/404" name="Page 404" element={<Page404 />} />
|
||||||
<Route exact path="/500" name="Page 500" element={<Page500 />} />
|
<Route exact path="/500" name="Page 500" element={<Page500 />} />
|
||||||
<Route
|
<Route
|
||||||
|
@ -16,7 +16,10 @@ import { createRoot } from "react-dom/client";
|
|||||||
|
|
||||||
const setupAxios = () => {
|
const setupAxios = () => {
|
||||||
// axios.defaults.baseURL = "http://localhost:5000";
|
// axios.defaults.baseURL = "http://localhost:5000";
|
||||||
|
//Old render deploy
|
||||||
// axios.defaults.baseURL = "https://cheminova-api-2.onrender.com";
|
// axios.defaults.baseURL = "https://cheminova-api-2.onrender.com";
|
||||||
|
//latest render deploy
|
||||||
|
//axios.defaults.baseURL = "https://cheminova-api1.onrender.com"
|
||||||
axios.defaults.baseURL = "https://api.cnapp.co.in";
|
axios.defaults.baseURL = "https://api.cnapp.co.in";
|
||||||
|
|
||||||
axios.defaults.headers = {
|
axios.defaults.headers = {
|
||||||
|
@ -179,6 +179,7 @@ import DistributorLiqudations from "./views/PrincipalDistributors/DistributorLiq
|
|||||||
import UpdatePrincipalDistributor from "./views/PrincipalDistributors/updateprincipaldistributor";
|
import UpdatePrincipalDistributor from "./views/PrincipalDistributors/updateprincipaldistributor";
|
||||||
import RDViewOrder from "./views/RetailerOrders/ViewOrder";
|
import RDViewOrder from "./views/RetailerOrders/ViewOrder";
|
||||||
import RetailerOrder from "./views/RetailerOrders/RetailerOrder";
|
import RetailerOrder from "./views/RetailerOrders/RetailerOrder";
|
||||||
|
import ForgotPassword from "./views/pages/register/ForgotPassword";
|
||||||
const routes = [
|
const routes = [
|
||||||
//dashboard
|
//dashboard
|
||||||
|
|
||||||
@ -189,6 +190,12 @@ const routes = [
|
|||||||
element: Change_Password,
|
element: Change_Password,
|
||||||
navName: "",
|
navName: "",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/forgot/password",
|
||||||
|
name: "Forgot Password",
|
||||||
|
element: ForgotPassword,
|
||||||
|
navName: "",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/profile/edit",
|
path: "/profile/edit",
|
||||||
name: "Edit Profile",
|
name: "Edit Profile",
|
||||||
|
@ -202,9 +202,11 @@ const Login = () => {
|
|||||||
</Link>
|
</Link>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
{/* <CButton color="link" className="px-0">
|
<Link to="/forgot/password">
|
||||||
<Link to="/password/forgot">Forgot password.?</Link>
|
<CButton className="px-0" color="link">
|
||||||
</CButton> */}
|
Forgot password.?
|
||||||
|
</CButton>
|
||||||
|
</Link>
|
||||||
</CForm>
|
</CForm>
|
||||||
</CCardBody>
|
</CCardBody>
|
||||||
{/* <CButton color="" className="px-0">
|
{/* <CButton color="" className="px-0">
|
||||||
|
@ -30,17 +30,19 @@ const ForgotPassword = () => {
|
|||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
|
|
||||||
const res = await axios.post(`/api/v1/user/password/forgot`, { email: email })
|
const res = await axios.post(`https://cheminova-api1.onrender.com/api/v1/user/password/forgot`, { email: email })
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
if (res.data.success === true) {
|
if (res.data.success === true) {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
// alert("Email Send Successfully! please check your mail for reset password")
|
// alert("Email Send Successfully! please check your mail for reset password")
|
||||||
swal("success!", "Email Send Successfully! please check your Email for new password", "success");
|
swal("success!", "'Password sent to your email Successfully!", "success");
|
||||||
navigate("/");
|
navigate("/");
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
swal('Error!', 'Wrong Email ID. Enter valid email to get the password', 'error')
|
const errorMessage = error?.response?.data?.message || 'Something went wrong!';
|
||||||
|
swal('Error!', errorMessage, 'error');
|
||||||
|
// swal('Error!', 'Wrong Email ID. Enter valid email to get the password', 'error')
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|
||||||
|
|
||||||
@ -52,7 +54,11 @@ const ForgotPassword = () => {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return <div className="bg-light min-vh-100 d-flex flex-row align-items-center">
|
return (
|
||||||
|
<div
|
||||||
|
className=" min-vh-100 d-flex flex-row align-items-center"
|
||||||
|
style={{ backgroundColor: "#179FAF" }}
|
||||||
|
>
|
||||||
<CContainer>
|
<CContainer>
|
||||||
<CRow className="justify-content-center">
|
<CRow className="justify-content-center">
|
||||||
<CCol md={9} lg={7} xl={6}>
|
<CCol md={9} lg={7} xl={6}>
|
||||||
@ -94,7 +100,7 @@ const ForgotPassword = () => {
|
|||||||
</CCol>
|
</CCol>
|
||||||
</CRow>
|
</CRow>
|
||||||
</CContainer>
|
</CContainer>
|
||||||
</div>;
|
</div>)
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ForgotPassword;
|
export default ForgotPassword;
|
||||||
|
Loading…
Reference in New Issue
Block a user