Create backend functionality of forgot password page
Do we need a forget password api where the user will get a link on the provided email, and from there he/she can change their password. OR, need a normal api taking email and new_password for forget password, and then updating the password of the user. Please clearify this.
@mahi25soni We will be sending an email to user on which he/she can change their password.
Ok @arpittyagi102 , actually I have made this functionality yesterday, and sent a PR also
Is this issue resolved?
@VanshVg, No this issue hasn't been solved yet, Do you want me to assign you ?
Yes I can work on this.
200
Hey there is a need of token field in mongoDB so would it be ok if I add token field in mongoDB?
okay @VanshVg, Add it
Ok thanx.
@arpittyagi102 I have implemented forgot password functionality meaning when forgot-password API will be called an email will be sent to user's email id in which there will be a link which will connect to reset-password page. Should I add reset-password functionality in backend too?
Hey @arpittyagi102 can you please confirm above comment??
Sorry for the late reply, It's amazing, Yes if you can add it to backend as well, that will be great 🌟
Ok sure. Also can you please help me with this one thing? In reset password API what I am doing is first checking if all fields(i.e. password and confirm password) are entered or not then checking if password and confirm password are equal if both condition satisfy then updating the value in database but during update I need email id of user so how can I get that?? Should I add a field of email in req.body or is there any way to fetch the stored token and using that token I can get email id?
Yes ask the user three things, email, password, confirm password compare password and confirm password in frontend if they are same then send them to backend. Ask me if you have any other doubt
I was just planning to add backend part of it as I'm not much familiar with frontend part. So would it be ok if I do only backend?
Yes, It's perfectly fine