Install dependencies:
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
- There exists a "Check Authentication" button on the Login page.
- If button clicked, and you are logged in, you will see a "Logout button"
- If button clicked, and no visible change, then you are not logged in.
- For dev purposes, note the
proxy
specifying the proxy port to the backend server, as defined inpackage.json
. CRA defaults to port 3000. - There exists a sample page for
randomcat2
that does not use HOC, or authentication. It is for demonstration purposes. - Available pages:
/login
/randomcat (auth protected)
/randomcat2
- API endpoint to login user currently returns a res.cookie and a duplicate copy in res.data.data.accessToken. Current front-end implementation expects this res.data cookie value.
- React will give the following warning in certain routing cases. It has been resolved for the case where a user logs in, goes to the /login page, "checks authentication", then logs out. However, for invalid route name handling, this warning will still occur. Using Redux and avoiding use of setState alleviates this problem.
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method
- React will give a warning for the pre-existing
CatImage.jsx
component. This should be an easy fix.
img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text