arpittyagi102 / LinkUp

Link Up is a real time chatting application project, it utilizes, MERN, socket.io
https://getlinkup.vercel.app
MIT License
22 stars 30 forks source link

Create backend functionality of forgot password page #8

Open arpittyagi102 opened 1 year ago

mahi25soni commented 1 year ago

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.

arpittyagi102 commented 1 year ago

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

mahi25soni commented 1 year ago

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

VanshVg commented 1 year ago

Is this issue resolved?

arpittyagi102 commented 1 year ago

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

VanshVg commented 1 year ago

Yes I can work on this.

arpittyagi102 commented 1 year ago

200

VanshVg commented 1 year ago

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

arpittyagi102 commented 1 year ago

okay @VanshVg, Add it

VanshVg commented 1 year ago

Ok thanx.

VanshVg commented 1 year ago

@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 commented 1 year ago

Hey @arpittyagi102 can you please confirm above comment??

arpittyagi102 commented 1 year ago

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

VanshVg commented 1 year ago

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?

arpittyagi102 commented 1 year ago

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

VanshVg commented 1 year ago

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?

arpittyagi102 commented 1 year ago

Yes, It's perfectly fine