Modify User Schema:
File: ./node_server/models/User.model.js
Action: Add two new fields forget_password_token and forget_password_expiry to the User schema.
Update Authentication Controller:
File: ./node_server/controller/auth.controllers.js
Actions: Add three new functions:
forgetPassword: Sends a reset password link to the provided email address.
resetPasswordVerify: Checks if the reset password link is valid.
resetPassword: Verifies the request with the reset password link and allows the user to change the password if the link is valid.
Extend Authentication Routes:
File: ./node_server/routes/auth.routes.js
Actions: Add three new routes for the respective functions:
POST /auth/forget-password for the forgetPassword function.
POST /auth/reset-password-verification for the resetPasswordVerify function.
POST /auth/reset-password for the resetPassword function.
Addition:
Email Template:
File: ./node_server/utils/sendEmail/Templates/forgetPasswordTemplate.js
Action: Create a template for the "forget password" email.
Issue #50 and #79: Duplicate Issues
Updation:
Modify User Schema: File: ./node_server/models/User.model.js Action: Add two new fields forget_password_token and forget_password_expiry to the User schema.
Update Authentication Controller: File: ./node_server/controller/auth.controllers.js Actions: Add three new functions: forgetPassword: Sends a reset password link to the provided email address. resetPasswordVerify: Checks if the reset password link is valid. resetPassword: Verifies the request with the reset password link and allows the user to change the password if the link is valid.
Extend Authentication Routes: File: ./node_server/routes/auth.routes.js Actions: Add three new routes for the respective functions: POST /auth/forget-password for the forgetPassword function. POST /auth/reset-password-verification for the resetPasswordVerify function. POST /auth/reset-password for the resetPassword function.
Addition:
https://github.com/govind-kumarr/simple_rag_dashboard/assets/133166222/68be3018-d51a-4ccf-8cee-8fdcfab186fe