Trisha-tech / OnlineBookSales

This project named Online Book Sales - Backend deals with developing an e-commerce website for Online Book Sale. It provides the user with a catalog of different books available for purchase in the store. In order to facilitate online purchase, a shopping cart is provided to the user.
https://book4u-j5au.onrender.com/
MIT License
136 stars 238 forks source link

Add refresh token and access token for reset password #27

Open ArtiGaund opened 6 months ago

ArtiGaund commented 6 months ago

Want to add refresh token and access token if user have to change the password, they can do it using tokens.

CodexRaunak commented 1 month ago

Can you assign it to me under GSSOC 24 extd @Trisha-tech @ArtiGaund

Trisha-tech commented 1 month ago

Can you assign it to me under GSSOC 24 extd @Trisha-tech @ArtiGaund

Hello @CodexRaunak, Go for it All the Best

CodexRaunak commented 1 month ago

Hey @Trisha-tech can you help me in this one issue, am I doing it correctly? image

CodexRaunak commented 1 month ago

I am facing this issuee in my local storage token is undefined, but its correctly sent via backend and its also showing in SetCookie header in network tab image

image Undefined in local storage image Not showing the cookie

Trisha-tech commented 1 month ago

Hey @Trisha-tech can you help me in this one issue, am I doing it correctly? image

Refer to this once. https://github.com/Trisha-tech/NodeJS-Backend/blob/master/routes/auth.js If still you are facing the problem, feel free to contact.

CodexRaunak commented 1 month ago

hey @Trisha-tech need help, i am not understanding it , I have been working on it for hours. There is already an exchangeToken function there which validates the refresh token from the frontend and then generate a new access and refresh token, so this thing ig is already implemented?

There is also a updatePassword controller, and there is a function for exchanging tokens as well. So what I have to do, like you mentioned in the reference , do I have to send the access token via email?

Also in postman i don't know why but the server is not responding the request. 404 not found. So how can I check my APIs, even I am not able to get the register route, which works perfectly fine in the website.

image

Trisha-tech commented 1 month ago

hey @Trisha-tech need help, i am not understanding it , I have been working on it for hours. There is already an exchangeToken function there which validates the refresh token from the frontend and then generate a new access and refresh token, so this thing ig is already implemented?

There is also a updatePassword controller, and there is a function for exchanging tokens as well. So what I have to do, like you mentioned in the reference , do I have to send the access token via email?

Also in postman i don't know why but the server is not responding the request. 404 not found. So how can I check my APIs, even I am not able to get the register route, which works perfectly fine in the website.

image

There is a need to first solve the register issues. Kindly wait till this issue has not been resolved. @CodexRaunak

CodexRaunak commented 1 month ago

Okay, I will also try to figure out the issue. The registration is working fine in the website, when I see the request and the response body and headers in the network tab. image But when I send this same post request with POSTMAN with req body to the URL http://localhost:8080/customer/register , its 404 not found