abhijeetnishal / Password-Shield

Password Manager Deployed Link 👇
https://passwordshield.vercel.app
16 stars 34 forks source link

feat:Implement reset password #126

Closed nishant0708 closed 3 months ago

nishant0708 commented 3 months ago

feat:Implement reset password #45

ADDED FORGOT PASSWORD FEATURE IN NEW UI

https://github.com/abhijeetnishal/Password-Shield/assets/101548649/2f1b2bdc-f6b0-480d-b9e4-86b80505a5ca

vercel[bot] commented 3 months ago

@nishant0708 is attempting to deploy a commit to the Abhijeet's projects Team on Vercel.

A member of the Team first needs to authorize it.

nishant0708 commented 3 months ago

Hey @abhijeetnishal you can check it now i have implemented it new Ui

nishant0708 commented 3 months ago

hey @abhijeetnishal You can check it now just few things . I have updated the generate token code for accepting expiry time of token as i anted that reset password link should expire after some time

nishant0708 commented 3 months ago

And there was No need to make forgot password and reset password as authenticated routes as that i have handled in controller .No user without token can edit or reset password

abhijeetnishal commented 3 months ago

hey @abhijeetnishal You can check it now just few things . I have updated the generate token code for accepting expiry time of token as i anted that reset password link should expire after some time

I have seen expiry thing, i guess it's there when I reviewed the code.

abhijeetnishal commented 3 months ago

And there was No need to make forgot password and reset password as authenticated routes as that i have handled in controller .No user without token can edit or reset password

Hey @nishant0708, the reason of doing this is not because it will work or handled in the controllers, it is because we need to follow the same API design or principles the project is following and also checking the token that is already being checked in auth middleware is just adding extra code and not using the existing code. For passwords route also we can do that check in controller it will work but it not follow DRY coding principles means repeating the same code.

I hope you understood the reason, do the necessary changes as mentioned.

nishant0708 commented 3 months ago

Hey @abhijeetnishal i will do it just give me some time i will have to Go through the logic again but i will figure it out no worries

nishant0708 commented 3 months ago

hey @abhijeetnishal please check my latest commit . I have tried everything but i am facing this error Screenshot 2024-06-14 043258 I have added token and everything Can you help me with this

abhijeetnishal commented 3 months ago

Hey @nishant0708, could you share the payload for the same, as you are showing response. Also we need to send token for reset route only not for forget as token can't be generated on client side.

nishant0708 commented 3 months ago

Screenshot 2024-06-14 091050 Screenshot 2024-06-14 091116 Screenshot 2024-06-14 091359 @abhijeetnishal This is of reset - password i have removed authentication from forgot-password

abhijeetnishal commented 3 months ago

Hey @nishant0708, of you see the payload, the token is missing this means somehow it's not sending from client that's why the server is not receiving and showing error. Whatever in payload will be send to server. Refer password routes how we are sending from client.

nishant0708 commented 3 months ago

Hey @abhijeetnishal I have checked password route in payload we are sending token the same way in reset route as password route

abhijeetnishal commented 3 months ago

Ok @nishant0708, i will check this issue and let you know, give me some time currently I am at work.

abhijeetnishal commented 3 months ago

Hey @nishant0708, i just checked with some random token appended with the URL it's working for me. Please check the correctly whenever you are resetting the password check in route that token exists.

Screenshot 2024-06-14 200427

nishant0708 commented 3 months ago

@abhijeetnishal It was working before as well but when I use is authenticated middleware in my route it is not working even with correct token but as soon as I remove that middleware it will work fine. remember video i attached

abhijeetnishal commented 3 months ago

No issues @nishant0708, I will fix it. I will review the code once done the necessary changes and this isAuthenticated I will fix.

abhijeetnishal commented 3 months ago

Hey @nishant0708, i have approved this PR.

Star this repo and share with your network. Thanks for contributing.