Skip to content

UseEffect in useAuth hook/provider #7

@Ifycode

Description

@Ifycode
useEffect(() => { 
    // Set isloading to true

    // read token from local storage
    // if token exists, 
        // read user data from local storage
        // set the user variable
        // set isAuthenticated to true

    // if token doesn't exist, 
        // set isAuthenticated to false

    // set isLoading to false
  }, []);

One of the suggestions from @faarda

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions