🦊 Authentication in a React App 🦊
Posted on Sep 20th, 2022
🗓️ Today’s topics
- Using Forms in React
- Revisit “What is logged in?” in code
- Requesting an auth token for login
🎯 Project
Work with your team to get the initial components in place for the QuestionBox or Social E-cards project.
Optional prep for Thursday
On Thursday we’ll be covering a way to add routing to our application with ReactRouter. If you want to get a head start, there’s a brand new React Router tutorial.
By Friday
- Your app can make GET requests for questions and answers OR cards and friends
- Show questions or cards on the page
- Have a solid start on POST requests for creating questions or cards
- Deploy to Netlify as soon as possible (TIP ⭐ Your code needs to run locally with no errors before you can deploy it!)
🔖 Resources
- POST requests with Axios
- Token Authentication Endpoint guide for djoser library -> This is the library being used by the backend
use-local-storage-state
-> You wouldnpm install use-local-storage-state
to use it in your code- Check out this custom hook code example, which shows how you could implement this yourself (you could even borrow this code and use it in your project instead of the above library if you wanted to).
- Using the Web Storage API
- How to Build a Front-End App Before you Have an API
- CORS explained for front-end devs
##