eyieko/landville-frontend

Expired tokens interfere with retrieving data from endpoints that are not protected

Opened this issue ยท 3 comments

When a user opens the site again after a day or so and wants to the available properties, they aren't able to do so and the spinner still spins

image

How can this be reproduced?

  1. Setup this token in the local-storage section eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6IkFoZWJ3YTEiLCJlbWFpbCI6ImNyeWNldHJ1bHlAZ21haWwuY29tIiwiZXhwIjoxNTUxNzc2Mzk0fQ.PFimaBvSaxR_cKwLmeRMod7LHkhNTcem22IXTrrg7Ko
  2. Open the properties page http://localhost:4200/properties
  3. You will see that the properties are not being loaded and yet the properties endpoint does not require a token.

Identified Gap

  1. Making sure that the properties page returns data even when a token is expired.

Examples

  1. In the properties page
  2. Home page when viewing trending properties
  3. In the product details page

Additional Context

maybe we could consider the approach taken in #36 whereby the token is decoded to see if it is valid or not before appending it to the request headers.

Hi, @Tevinthuku I once raised this issue and I had a sync with @CryceTruly @patrickf949 & @Manorlds-Eaglespark and we added the implementation his PR #36. You may checkout the implementation to confirm the fix.

This is actually handled in the PR #36. That will fix it when merged.

Okay @Victoradukwu @alexxsanya , this will close automatically once the PR is merged ๐Ÿ‘