From 7de9f951b9558f1b447de994993ea4947a280489 Mon Sep 17 00:00:00 2001 From: Satyendra <21cs2028@rgipt.ac.in> Date: Tue, 30 Jul 2024 18:31:40 +0530 Subject: [PATCH 1/2] Implemented forgot password --- README.md | 4 +- client/package-lock.json | 31 ++++++++ client/src/App.jsx | 4 + .../src/components/Forgot-Password/index.jsx | 54 +++++++++++++ .../src/components/Reset-Password/index.jsx | 76 +++++++++++++++++++ client/src/pages/Login/login.jsx | 32 +++++--- server/.env | 5 +- server/controllers/forgotPassword.js | 66 ++++++++++++++++ server/package-lock.json | 26 ++++++- server/package.json | 5 +- .../migration.sql | 13 ++++ server/prisma/schema.prisma | 11 +++ server/routes/user.js | 5 ++ server/utils/email.js | 28 +++++++ 14 files changed, 344 insertions(+), 16 deletions(-) create mode 100644 client/src/components/Forgot-Password/index.jsx create mode 100644 client/src/components/Reset-Password/index.jsx create mode 100644 server/controllers/forgotPassword.js create mode 100644 server/prisma/migrations/20240729205650_add_password_reset_token/migration.sql create mode 100644 server/utils/email.js diff --git a/README.md b/README.md index ecd5a4b..964e6d2 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,9 @@ Ensure that `Node.js` and `MySQL` are installed on your machine. 2. Replace `user` and `password` from `DATABASE_URL="mysql://user:password@localhost:3306/drawn2shoe" ` with your credential of mysql in the `.env` file. - + + 3. Replace `yourmail@gmail.com` and `your_password` with a actual Email address and Password. Make sure your two-factor-authentication is on for this mail. This address would be used to send reset links for forgot password. (This step is only necessary if you working on forgot password else leave it as it is.) +