lugenx/ecohabit

Use Token from UserContext in Homepage Component

Closed this issue · 3 comments

lugenx commented

Refactor the Homepage component to get the user token from UserContext instead of directly from localStorage.

Steps:

  1. Replace localStorage.getItem("token") with the token from useUserContext.

    Remove:

    const token = localStorage.getItem("token");

    Update importing userContext to look like this:

    const { user, setUser, token } = useUserContext();
  2. Ensure the app's functionality remains unchanged.


⚠️ Before you start working on this issue, please comment below expressing your interest, and wait to be assigned. ⚠️

I want to do my first contribution, can you assign me this issue?

lugenx commented

assigned, thank you @Devrishi-Dutta . Let me know if you have any question.

Am I supposed to do anything else after making the pull request? (in this issue )