odenizddd / e-commerce-app

0 stars 0 forks source link

Apply authorization to add cart endpoint. #3

Closed odenizddd closed 2 months ago

odenizddd commented 2 months ago

JWT token will containt username. So get the cart id from username and use that cart id add the specified product. In the add cart endpoint feed the username that comes from the JWT token to fetch the cart id. Disregard the username that comes from the body.

odenizddd commented 2 months ago

I wrote a function that fetches the user id given a username and didn't change the rest of the workflow. It seems to be working.