LinkUp icon indicating copy to clipboard operation
LinkUp copied to clipboard

Create backend functionality of forgot password page

Open arpittyagi102 opened this issue 2 years ago • 17 comments

arpittyagi102 avatar Jun 30 '23 17:06 arpittyagi102

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 avatar Jul 09 '23 21:07 mahi25soni

@mahi25soni We will be sending an email to user on which he/she can change their password.

arpittyagi102 avatar Jul 10 '23 04:07 arpittyagi102

Ok @arpittyagi102 , actually I have made this functionality yesterday, and sent a PR also

mahi25soni avatar Jul 10 '23 05:07 mahi25soni

Is this issue resolved?

VanshVg avatar Jul 25 '23 18:07 VanshVg

@VanshVg, No this issue hasn't been solved yet, Do you want me to assign you ?

arpittyagi102 avatar Jul 25 '23 18:07 arpittyagi102

Yes I can work on this.

VanshVg avatar Jul 25 '23 18:07 VanshVg

200

arpittyagi102 avatar Jul 25 '23 18:07 arpittyagi102

Hey there is a need of token field in mongoDB so would it be ok if I add token field in mongoDB?

VanshVg avatar Jul 25 '23 19:07 VanshVg

okay @VanshVg, Add it

arpittyagi102 avatar Jul 26 '23 03:07 arpittyagi102

Ok thanx.

VanshVg avatar Jul 26 '23 05:07 VanshVg

@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?

VanshVg avatar Jul 26 '23 07:07 VanshVg

Hey @arpittyagi102 can you please confirm above comment??

VanshVg avatar Jul 27 '23 05:07 VanshVg

Sorry for the late reply, It's amazing, Yes if you can add it to backend as well, that will be great 🌟

arpittyagi102 avatar Jul 27 '23 17:07 arpittyagi102

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?

VanshVg avatar Jul 27 '23 18:07 VanshVg

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

arpittyagi102 avatar Jul 27 '23 18:07 arpittyagi102

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?

VanshVg avatar Jul 27 '23 18:07 VanshVg

Yes, It's perfectly fine

arpittyagi102 avatar Jul 27 '23 18:07 arpittyagi102