-
Book Overview & Buying
-
Table Of Contents
React Application Architecture for Production - Second Edition
By :
Authentication is the process of verifying who a user is. When a user logs into our application, we need to verify their identity and then remember who they are as they navigate through different pages and make requests to our API. This is fundamental to building applications that serve personalized content and protect sensitive data.
Without authentication, we can't distinguish between different users or restrict access to certain features. Every user would see the same content, and anyone could access any data. This works for public websites, but most applications need to know who is using them.
We'll implement authentication using a token-based approach. When users log in with their credentials, our API will verify them and send back authentication tokens. These tokens will be stored in httpOnly cookies, which are cookies that JavaScript can't access. This is important because it protects the tokens from being stolen by malicious scripts that might run...