Closed hiyaryan closed 10 months ago
Uses context to use journalId
across React app. If there is a journalId
a user has signed in or registered. This means that they have access to the full scope of the react app besides login and registration routes.
Note that if the user updates the url directly, the journal context is refreshed and they must log in again. It might be useful to use local storage instead to store the journal id as opposed to context if at some point users want to use the url to navigate.
Additionally, this PR adds a an API layer to the react app where all API calls are made as opposed to being made within each component itself such as in their useEffect
hooks. This is done using two new custom hooks useEntries
for all things entries related and useAccess
for all things access related such as login, register, and logout.
Adds frontend authorization to ensure users only have access to their data and must be logged in or logged out to to have access to various actions such as Logout and Login, respectively.