gorgot password deploy
This commit is contained in:
parent
64c927f27b
commit
10de1de3c2
26
package.json
26
package.json
@ -13,18 +13,19 @@
|
||||
"license": "MIT",
|
||||
"author": "The CoreUI Team (https://github.com/orgs/coreui/people)",
|
||||
"scripts": {
|
||||
"dev": "react-scripts start",
|
||||
"build": "react-scripts --openssl-legacy-provider build",
|
||||
"changelog": "auto-changelog --starting-version 4.1.0 --commit-limit false --hide-credit",
|
||||
"eject": "react-scripts eject",
|
||||
"lint": "eslint \"src/**/*.js\"",
|
||||
"start": "serve -s build",
|
||||
"start:n17": "react-scripts --openssl-legacy-provider start",
|
||||
"test": "react-scripts test",
|
||||
"test:cov": "npm test -- --coverage --watchAll=false",
|
||||
"test:debug": "react-scripts --inspect-brk test --runInBand",
|
||||
"heroku-postbuild": "npm run build"
|
||||
},
|
||||
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-scripts start",
|
||||
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-scripts build",
|
||||
"changelog": "auto-changelog --starting-version 4.1.0 --commit-limit false --hide-credit",
|
||||
"eject": "react-scripts eject",
|
||||
"lint": "eslint \"src/**/*.js\"",
|
||||
"start": "serve -s build",
|
||||
"start:n17": "react-scripts --openssl-legacy-provider start",
|
||||
"test": "react-scripts test",
|
||||
"test:cov": "npm test -- --coverage --watchAll=false",
|
||||
"test:debug": "react-scripts --inspect-brk test --runInBand",
|
||||
"heroku-postbuild": "npm run build"
|
||||
}
|
||||
,
|
||||
"config": {
|
||||
"coreui_library_short_version": "4.1"
|
||||
},
|
||||
@ -86,6 +87,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"auto-changelog": "~2.3.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"fuse.js": "^6.6.2",
|
||||
"react-scripts": "^4.0.3",
|
||||
"sass": "^1.43.5"
|
||||
|
@ -199,6 +199,7 @@ import { isAutheticated } from "./auth";
|
||||
import "./scss/style.scss";
|
||||
import ProtectedRoute from "./components/ProtectedRoute";
|
||||
import axios from "axios";
|
||||
import ForgotPassword from "./views/pages/register/ForgotPassword";
|
||||
// Containers
|
||||
const DefaultLayout = React.lazy(() => import("./layout/DefaultLayout"));
|
||||
|
||||
@ -254,6 +255,8 @@ const App = () => {
|
||||
<Routes>
|
||||
{/* <Route exact path="/change-password" name="My profile" element={<ChangePassword />} /> */}
|
||||
<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="/500" name="Page 500" element={<Page500 />} />
|
||||
<Route
|
||||
|
@ -16,7 +16,10 @@ import { createRoot } from "react-dom/client";
|
||||
|
||||
const setupAxios = () => {
|
||||
// axios.defaults.baseURL = "http://localhost:5000";
|
||||
//Old render deploy
|
||||
// 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.headers = {
|
||||
|
@ -179,6 +179,7 @@ import DistributorLiqudations from "./views/PrincipalDistributors/DistributorLiq
|
||||
import UpdatePrincipalDistributor from "./views/PrincipalDistributors/updateprincipaldistributor";
|
||||
import RDViewOrder from "./views/RetailerOrders/ViewOrder";
|
||||
import RetailerOrder from "./views/RetailerOrders/RetailerOrder";
|
||||
import ForgotPassword from "./views/pages/register/ForgotPassword";
|
||||
const routes = [
|
||||
//dashboard
|
||||
|
||||
@ -189,6 +190,12 @@ const routes = [
|
||||
element: Change_Password,
|
||||
navName: "",
|
||||
},
|
||||
{
|
||||
path: "/forgot/password",
|
||||
name: "Forgot Password",
|
||||
element: ForgotPassword,
|
||||
navName: "",
|
||||
},
|
||||
{
|
||||
path: "/profile/edit",
|
||||
name: "Edit Profile",
|
||||
|
@ -202,9 +202,11 @@ const Login = () => {
|
||||
</Link>
|
||||
<br />
|
||||
|
||||
{/* <CButton color="link" className="px-0">
|
||||
<Link to="/password/forgot">Forgot password.?</Link>
|
||||
</CButton> */}
|
||||
<Link to="/forgot/password">
|
||||
<CButton className="px-0" color="link">
|
||||
Forgot password.?
|
||||
</CButton>
|
||||
</Link>
|
||||
</CForm>
|
||||
</CCardBody>
|
||||
{/* <CButton color="" className="px-0">
|
||||
|
@ -30,17 +30,19 @@ const ForgotPassword = () => {
|
||||
try {
|
||||
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);
|
||||
if (res.data.success === true) {
|
||||
setLoading(false)
|
||||
// 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("/");
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
swal('Error!', 'Wrong Email ID. Enter valid email to get the password', 'error')
|
||||
} catch (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)
|
||||
|
||||
|
||||
@ -52,49 +54,53 @@ const ForgotPassword = () => {
|
||||
|
||||
|
||||
}
|
||||
return <div className="bg-light min-vh-100 d-flex flex-row align-items-center">
|
||||
<CContainer>
|
||||
<CRow className="justify-content-center">
|
||||
<CCol md={9} lg={7} xl={6}>
|
||||
<CCard className="mx-4">
|
||||
<CCardBody className="p-4">
|
||||
<CForm>
|
||||
<h1>Forgot Password?</h1>
|
||||
<p className="text-medium-emphasis"> Enter your email Below, we will send you password in your Email</p>
|
||||
{/* <CInputGroup className="mb-3">
|
||||
return (
|
||||
<div
|
||||
className=" min-vh-100 d-flex flex-row align-items-center"
|
||||
style={{ backgroundColor: "#179FAF" }}
|
||||
>
|
||||
<CContainer>
|
||||
<CRow className="justify-content-center">
|
||||
<CCol md={9} lg={7} xl={6}>
|
||||
<CCard className="mx-4">
|
||||
<CCardBody className="p-4">
|
||||
<CForm>
|
||||
<h1>Forgot Password?</h1>
|
||||
<p className="text-medium-emphasis"> Enter your email Below, we will send you password in your Email</p>
|
||||
{/* <CInputGroup className="mb-3">
|
||||
<CInputGroupText>
|
||||
<CIcon icon={cilUser} />
|
||||
</CInputGroupText>
|
||||
<CFormInput placeholder="Username" autoComplete="username" />
|
||||
</CInputGroup> */}
|
||||
|
||||
<CInputGroup className="mb-4">
|
||||
<CInputGroupText>
|
||||
<CIcon icon={cilEnvelopeOpen} />
|
||||
</CInputGroupText>
|
||||
<CFormInput
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
autoComplete="email"
|
||||
// value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
/>
|
||||
</CInputGroup>
|
||||
<CInputGroup className="mb-4">
|
||||
<CInputGroupText>
|
||||
<CIcon icon={cilEnvelopeOpen} />
|
||||
</CInputGroupText>
|
||||
<CFormInput
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
autoComplete="email"
|
||||
// value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
/>
|
||||
</CInputGroup>
|
||||
|
||||
<CButton color="primary" disabled={!email} onClick={() => handleSubmit()}>
|
||||
<ClipLoader loading={loading} size={18} />
|
||||
{!loading && "Send"}
|
||||
</CButton>
|
||||
<Link to='/'>
|
||||
<CButton color="secondary" className='ms-2'>Back to Login</CButton>
|
||||
</Link>
|
||||
</CForm>
|
||||
</CCardBody>
|
||||
</CCard>
|
||||
</CCol>
|
||||
</CRow>
|
||||
</CContainer>
|
||||
</div>;
|
||||
<CButton color="primary" disabled={!email} onClick={() => handleSubmit()}>
|
||||
<ClipLoader loading={loading} size={18} />
|
||||
{!loading && "Send"}
|
||||
</CButton>
|
||||
<Link to='/'>
|
||||
<CButton color="secondary" className='ms-2'>Back to Login</CButton>
|
||||
</Link>
|
||||
</CForm>
|
||||
</CCardBody>
|
||||
</CCard>
|
||||
</CCol>
|
||||
</CRow>
|
||||
</CContainer>
|
||||
</div>)
|
||||
};
|
||||
|
||||
export default ForgotPassword;
|
||||
|
Loading…
Reference in New Issue
Block a user