This commit is contained in:
omkieit 2024-09-09 22:08:14 +05:30
parent 875198f7e5
commit 3231e5021b
5 changed files with 20 additions and 16 deletions

View File

@ -20,6 +20,8 @@ export const signup = async (req, res) => {
// Hash the password // Hash the password
const hashedPassword = await bcrypt.hash(password, 12); const hashedPassword = await bcrypt.hash(password, 12);
const randomNumber = generateRandomNumber().toString();
const userId = `EF${randomNumber}`;
// Create new user // Create new user
const result = await UserModal.create({ const result = await UserModal.create({
@ -31,6 +33,7 @@ export const signup = async (req, res) => {
lastName, lastName,
termsconditions, termsconditions,
userType, userType,
userId:userId,
}); });
// Generate JWT (if needed) // Generate JWT (if needed)

View File

@ -13,6 +13,7 @@ const userSchema = new mongoose.Schema({
id: { type: String }, id: { type: String },
resetToken: { type: String }, resetToken: { type: String },
resetTokenExpiration: { type: String }, resetTokenExpiration: { type: String },
userId:{type:String},
tokens:[ tokens:[
{ {
token:{ token:{

File diff suppressed because one or more lines are too long

View File

@ -27,7 +27,7 @@
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"> <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<!-- fonts --> <!-- fonts -->
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;800&family=Sen:wght@400;700;800&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;800&family=Sen:wght@400;700;800&display=swap" rel="stylesheet">
<script type="module" crossorigin src="/assets/index-dKDP2exv.js"></script> <script type="module" crossorigin src="/assets/index-DAjohXmt.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CyAHZLBw.css"> <link rel="stylesheet" crossorigin href="/assets/index-CyAHZLBw.css">
</head> </head>

View File

@ -1,7 +1,8 @@
import { useState } from "react"; import { useState } from "react";
import axios from "axios"; import axios from "axios";
import Navbar from "./Navbar"; import Navbar from "./Navbar";
import Footer from "../components/Footer"; import Footer from "./Footer";
import { NavLink } from "react-router-dom";
@ -111,12 +112,11 @@ const ForgotPassword = () => {
<div className="d-flex gap-2 gap-md-4 flex-column flex-md-row justify-content-md-end mt-4"> <div className="d-flex gap-2 gap-md-4 flex-column flex-md-row justify-content-md-end mt-4">
<p className="m-0 text-secondary text-center"> <p className="m-0 text-secondary text-center">
Already have an account?{" "} Already have an account?{" "}
<a
href="#!" <NavLink to="/login" className="link-primary text-decoration-none">
className="link-primary text-decoration-none" Sign In
> </NavLink>
Sign in
</a>
</p> </p>
</div> </div>
</div> </div>
@ -129,7 +129,7 @@ const ForgotPassword = () => {
</div> </div>
</div> </div>
</div> </div>
<Footer /> <Footer />
</section> </section>