React Authentication Guide
Learn how to implement secure React authentication using JWT, Auth0, Firebase, Supabase, Clerk, Better Auth, and React Context. Build login systems, protect routes, secure APIs, and follow modern security best practices.

React Authentication: The Complete Guide to Building Secure Login Systems
Every modern web application requires a reliable way to identify users and control access to sensitive information. Whether you're building a SaaS platform, an admin dashboard, an eCommerce website, or a social networking application, authentication is one of the first features you'll implement.
React itself doesn't provide an authentication system. Instead, it gives developers the flexibility to integrate authentication using APIs, third-party services, or custom backend implementations. This flexibility is one of React's biggest strengths, but it also means developers need to understand authentication concepts before deciding which solution is right for their project.
In this guide, you'll learn everything you need to know about React authentication—from the basic concepts to advanced production-ready implementations. We'll explore JSON Web Tokens (JWT), OAuth, session-based authentication, protected routes, API security, refresh tokens, popular authentication providers, and best practices followed by modern React applications.
Whether you're building your very first login page or designing authentication for a large-scale production application, this guide will help you choose the right architecture and avoid common security mistakes.
Recommended Reading Time: 20–25 minutes
What Is React Authentication?
React authentication is the process of verifying a user's identity before allowing access to protected areas of your application.
Whenever someone signs in using an email and password, Google account, GitHub account, or any other identity provider, your application needs to determine:
Who the user is
Whether the credentials are valid
What permissions the user has
Which pages they can access
Which API endpoints they can call
Without authentication, every visitor would have unrestricted access to your application, exposing sensitive information and potentially allowing malicious actions.
Authentication is often confused with authorization, but they're two different concepts.
Authentication | Authorization |
|---|---|
Verifies identity | Determines permissions |
Answers "Who are you?" | Answers "What can you access?" |
Happens first | Happens after authentication |
Login process | Role and permission checking |
A user must first prove their identity before your application decides what they're allowed to do.
Why Authentication Matters
Imagine you're building an online banking platform.
Without authentication:
Anyone could view account balances.
Transactions could be performed without verification.
Personal information would be publicly accessible.
The application would be completely insecure.
Even much simpler applications require authentication.
Examples include:
Admin dashboards
Blog CMS
SaaS products
Learning management systems
Social media platforms
CRM software
Healthcare portals
Project management tools
Authentication acts as the gatekeeper that ensures every user only accesses information they're permitted to see.
How React Authentication Works
Although every authentication provider has slightly different implementation details, the overall flow remains almost identical.
A visitor opens your application.
They click the Login button.
They submit their credentials.
Your frontend sends those credentials to the authentication server.
The server verifies the credentials.
If successful, the server returns an authentication token or session.
React stores the authentication state.
Protected pages become accessible.
API requests include authentication credentials.
When the user logs out, authentication data is removed.
Visually, the flow looks like this:
User → Login Form → Authentication Server → Token → React Application → Protected Routes → Secure API
Understanding this lifecycle makes it much easier to implement any authentication provider.
Components of a Modern Authentication System
A complete authentication system consists of several independent pieces working together.
Login Page
The login page collects user credentials.
Typical fields include:
Email
Username
Password
Remember Me
Forgot Password
Some applications also provide social login options like Google or GitHub.
Registration
Registration allows new users to create accounts.
Most applications collect:
Full name
Email
Password
Password confirmation
Production applications usually verify email addresses before activating accounts.
Password Recovery
Forgot password functionality lets users regain access without contacting support.
The common workflow is:
User enters email.
Server generates a secure reset token.
Email is sent.
User clicks reset link.
Password is updated.
Authentication State
Once logged in, React needs to know whether a user is authenticated.
Typical state includes:
User object
Access token
Authentication status
Loading state
User role
Most applications manage this using React Context or state management libraries.
Protected Routes
Certain pages should only be accessible after authentication.
Examples include:
Dashboard
Billing
Settings
Admin Panel
User Profile
If an unauthenticated visitor tries accessing these pages, they should be redirected to the login page.
Logout
Logging out clears all authentication information.
A proper logout should:
Remove access tokens
Remove refresh tokens
Clear user information
Invalidate sessions if required
Redirect users safely
Choosing an Authentication Strategy
There isn't a single authentication method suitable for every React application.
The best approach depends on your project's requirements, security needs, scalability goals, and development timeline.
Below are the most common authentication strategies used in React applications today.
Session-Based Authentication
Session authentication stores user information on the server.
After a successful login, the server creates a session and sends a secure cookie back to the browser.
Every subsequent request automatically includes this cookie.
Advantages include:
Excellent security
Easy session invalidation
No token management
Traditional backend architecture
Disadvantages include:
Requires server-side session storage
Less suitable for serverless deployments
Harder to scale across multiple servers
Session authentication remains popular for enterprise applications and traditional web platforms.
JSON Web Token (JWT) Authentication
JWT authentication is currently the most common approach for React applications.
Instead of storing sessions on the server, authentication information is stored inside a signed token.
The client sends this token with every API request.
Benefits include:
Stateless architecture
Highly scalable
Ideal for SPAs
Perfect for REST APIs
Works well with microservices
Challenges include:
Token expiration
Refresh token implementation
Secure storage
Token revocation
JWT is the preferred solution for many modern React applications because it scales extremely well across distributed systems.
OAuth Authentication
OAuth enables users to log in using existing accounts such as:
Google
GitHub
Microsoft
Apple
Facebook
LinkedIn
Instead of storing passwords, your application delegates authentication to a trusted identity provider.
Benefits include:
Faster onboarding
Better user experience
Increased trust
Lower maintenance
OAuth is commonly combined with JWT or session authentication rather than replacing them completely.
Passwordless Authentication
Passwordless authentication removes passwords entirely.
Instead, users verify themselves using:
Magic links
One-time passwords (OTP)
Biometrics
Passkeys
Passwordless systems significantly reduce phishing risks while improving user experience.
Many modern SaaS products are adopting this approach.
JWT Authentication Explained
If you've searched for React authentication tutorials, you've almost certainly encountered JWT.
JWT stands for JSON Web Token, a compact format used to securely transmit authentication information between a client and server.
A JWT consists of three parts:
Header
Payload
Signature
The signature ensures the token hasn't been modified after it was issued.
After login, the server generates a signed token and returns it to React.
React then attaches that token to future API requests using the Authorization header.
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Your backend verifies the signature before processing the request.
Because JWTs are self-contained, servers don't need to store sessions, making them highly scalable for cloud-native applications.
Where Should JWTs Be Stored?
One of the biggest debates in frontend authentication is where to store tokens.
The most common options are:
Storage | Recommended |
HttpOnly Cookies | ✅ Best |
Memory | ✅ Very Good |
localStorage | ⚠ Use Carefully |
sessionStorage | ⚠ Acceptable |
HttpOnly cookies provide the strongest protection against JavaScript-based attacks because they cannot be accessed by client-side scripts.
For production applications, security experts generally recommend HttpOnly cookies whenever possible.
Managing Authentication State in React
After a user successfully logs in, your application needs a reliable way to remember who they are. This is known as the authentication state. Without it, users would have to log in every time they navigate to another page or refresh the browser.
A good authentication state usually contains:
The authenticated user object
Whether the user is currently logged in
Access token or session information
Loading state while authentication is being verified
User roles and permissions
Modern React applications typically manage this state using React Context, although larger applications may integrate Redux, Zustand, or other state management libraries.
The goal is simple: every component in your application should be able to know whether a user is authenticated without repeatedly making unnecessary API requests.
Using React Context for Authentication
React Context is one of the simplest and most effective ways to share authentication data across your application.
Instead of passing user information through multiple component levels, Context provides a single source of truth that every component can access.
A typical authentication context provides:
Current user
Login function
Logout function
Loading state
Authentication status
This keeps your code organized while making authentication easy to maintain as your application grows.
Why React Context Works So Well
Authentication is global state.
Whether you're on the dashboard, settings page, profile page, or homepage, every component should instantly know whether the visitor is logged in.
React Context eliminates unnecessary prop drilling and keeps authentication logic centralized.
For small to medium-sized applications, it's often the perfect solution.
Building Login and Registration Components
Every authentication system begins with two essential user interfaces:
Login
Registration
A good login form should be clean, simple, and distraction-free.
The minimum fields include:
Email
Password
Optional additions include:
Remember Me
Forgot Password
Show Password
Continue with Google
Continue with GitHub
Continue with Microsoft
For registration forms, ask only for the information you genuinely need. Long signup forms often reduce conversion rates and discourage new users from creating accounts.
Form Validation Best Practices
Authentication forms should validate user input before sending requests to the server.
Useful validations include:
Required fields
Valid email format
Minimum password length
Password confirmation
Maximum character limits
Displaying validation errors immediately improves the user experience and reduces unnecessary API requests.
For example:
✔ Enter a valid email address.
✔ Password must contain at least 8 characters.
✔ Passwords do not match.
Helpful, human-friendly messages are always better than vague errors like "Invalid Input."
Connecting React to Your Backend
Authentication doesn't happen inside React itself.
Your frontend is responsible for collecting user credentials, while the backend verifies those credentials and decides whether authentication should succeed.
The communication typically follows this flow:
User submits the login form.
React sends the credentials to an API.
Backend validates the credentials.
Backend generates a session or access token.
React stores the authentication state.
Protected pages become available.
Keeping these responsibilities separate makes your application more secure and easier to maintain.
Using Axios or Fetch for Authentication Requests
React applications usually communicate with authentication APIs using either Fetch or Axios.
The login request generally contains:
Email
Password
The server responds with:
Access token
Refresh token (optional)
User information
Expiration time
After receiving a successful response, your application updates its authentication state and redirects the user to the appropriate page.
Always remember that passwords should only travel over HTTPS in production environments.
Protecting Routes in React
One of the most important features of authentication is preventing unauthorized users from accessing private pages.
Examples include:
Dashboard
User Profile
Billing
Settings
Admin Panel
If someone manually enters a protected URL without logging in, your application should redirect them back to the login page.
This process is commonly known as route protection.
Creating Private Routes
React Router makes protecting pages straightforward.
A Private Route checks whether the user is authenticated before rendering the requested page.
If authentication succeeds:
The protected component is displayed.
If authentication fails:
The visitor is redirected to the login page.
This creates a much smoother user experience than displaying an error after the page has already loaded.
Modern authentication libraries usually provide this functionality out of the box.
Showing Loading States
One mistake many beginners make is rendering protected pages before authentication has finished loading.
Imagine this sequence:
Dashboard appears for a split second.
User is redirected to Login.
Dashboard flashes again.
This flashing creates a poor user experience.
Instead, display a loading screen while authentication is being verified.
A simple loading spinner or skeleton screen prevents UI flickering and makes the application feel much more polished.
Displaying User Information
Once authentication succeeds, you can personalize your application using the authenticated user's information.
Common profile data includes:
Name
Email
Avatar
Username
Role
Displaying personalized information makes applications feel significantly more engaging.
Examples include:
Welcome back, Sarah.
Hello, John!
Good evening, Alex.
These small touches create a much more polished user experience.
Understanding Authentication Providers
Building authentication completely from scratch isn't always the best choice.
Many companies offer authentication platforms that handle security, infrastructure, password storage, social logins, and compliance for you.
Choosing the right provider depends on your project requirements.
Let's look at the most popular options.
Auth0
Auth0 is one of the most mature authentication platforms available today.
Instead of building login pages and handling password storage yourself, Auth0 provides a secure hosted authentication experience.
The authentication flow works like this:
User clicks Login.
↓
React redirects to Auth0.
↓
User signs in securely.
↓
Auth0 verifies credentials.
↓
JWT is returned.
↓
React stores authentication state.
↓
Protected routes become accessible.
Auth0 supports:
Email & Password
Google Login
GitHub Login
Apple Login
Microsoft Login
Facebook Login
Enterprise SSO
Multi-Factor Authentication
Why Developers Choose Auth0
Advantages include:
Extremely secure
Easy React SDK
Hosted login pages
Excellent documentation
Enterprise ready
Role-based access control
OAuth support
OpenID Connect support
Potential drawbacks:
Premium pricing for larger applications
Learning curve for advanced configurations
For production SaaS products, Auth0 remains one of the strongest authentication solutions available.
Firebase Authentication
Firebase Authentication is one of Google's most popular developer services.
It's especially attractive for startups and small projects because setup is incredibly fast.
Supported authentication methods include:
Email & Password
Google
Apple
GitHub
Facebook
Anonymous Login
Phone Authentication
Firebase automatically manages:
User accounts
Password hashing
Sessions
Token generation
Password resets
Developers can focus on building features instead of authentication infrastructure.
When Firebase Is a Great Choice
Firebase works particularly well for:
MVPs
Personal projects
Mobile apps
React applications
Startup products
If your backend already relies heavily on Firebase services like Firestore or Cloud Functions, Firebase Authentication is often the most natural choice.
Clerk
Clerk has become increasingly popular among React and Next.js developers.
Unlike traditional authentication providers, Clerk focuses heavily on developer experience and beautiful pre-built user interfaces.
Instead of creating login forms from scratch, you can integrate polished authentication components within minutes.
Clerk provides ready-made interfaces for:
Login
Registration
User Profile
Password Reset
Account Settings
Multi-factor Authentication
This dramatically reduces development time while maintaining a professional appearance.
Supabase Authentication
Supabase combines authentication with a complete backend platform.
It offers:
PostgreSQL database
Authentication
Storage
Edge Functions
Realtime APIs
Authentication methods include:
Email
Magic Links
Google
GitHub
Apple
Phone Login
Supabase is particularly appealing to developers who want an open-source Firebase alternative while maintaining complete ownership of their data.
Better Auth
Better Auth is one of the newest authentication libraries gaining attention in the React ecosystem.
Its philosophy is simple:
Give developers complete control without relying on proprietary authentication services.
Advantages include:
Open source
Type-safe
Framework agnostic
Self-hosted
Excellent developer experience
If your project values flexibility and ownership over convenience, Better Auth is worth considering.
SuperTokens
SuperTokens sits somewhere between self-hosted authentication and managed authentication platforms.
It offers:
Session management
Email/password authentication
Social logins
Password resets
Email verification
Multi-factor authentication
One of SuperTokens' biggest strengths is that you can self-host it while still enjoying a polished developer experience.
This makes it attractive for organizations that need greater control over authentication infrastructure without building everything from scratch.
Which Authentication Provider Should You Choose?
There isn't a universal winner.
Different projects have different priorities.
Project Type | Recommended Solution |
|---|---|
Personal Project | Firebase |
Startup MVP | Clerk or Firebase |
Enterprise SaaS | Auth0 |
Open Source Stack | Better Auth |
Self-Hosted Applications | SuperTokens |
Full Backend Platform | Supabase |
Choosing the right authentication provider early can save hundreds of development hours later.
Securing API Requests
Authenticating the user is only half the job.
Your APIs also need to verify every incoming request.
When React calls a protected endpoint, it usually includes an access token inside the Authorization header.
The backend validates this token before returning any sensitive information.
If verification fails, the server responds with an authorization error instead of protected data.
This ensures that simply knowing an API endpoint isn't enough to access private information.
Calling Protected APIs
A secure API request generally follows this sequence:
User logs in.
↓
React receives an access token.
↓
React sends the token with each request.
↓
Backend validates the token.
↓
Protected data is returned.
This verification process happens on every protected request, ensuring only authenticated users can access restricted resources.
Refresh Tokens
Access tokens shouldn't live forever.
Short-lived tokens reduce the impact if they're ever stolen.
When an access token expires, users shouldn't have to log in again every few minutes.
That's where refresh tokens become important.
Instead of requesting credentials again, the application silently exchanges the refresh token for a new access token.
This keeps users logged in while maintaining strong security.
Large production applications almost always implement this strategy.
Logging Out Securely
Logging out should do more than redirect users.
A secure logout should:
Remove authentication state
Remove access tokens
Invalidate refresh tokens when applicable
Clear cached user information
Redirect to a safe public page
Proper logout ensures previously authenticated sessions cannot continue accessing protected resources.
Authentication Security Best Practices
Implementing a login page is only the beginning. The real challenge is ensuring your authentication system remains secure against modern attacks. Many security vulnerabilities don't come from complex exploits—they result from small implementation mistakes that are easy to overlook.
Whether you're building a personal project or an enterprise SaaS platform, following security best practices from the start will save you countless hours of debugging and significantly reduce potential security risks.
Always Use HTTPS
Every authentication request contains sensitive information, whether it's a password, access token, or session cookie.
Without HTTPS, this data can potentially be intercepted while traveling between the browser and your server.
HTTPS encrypts all communication between the client and server, protecting user credentials and authentication tokens from being exposed.
Modern browsers even mark non-HTTPS websites as "Not Secure," which immediately reduces user trust.
For production applications, HTTPS should never be optional.
Never Store Plain Passwords
Passwords should never be stored directly in your database.
Instead, they must be securely hashed using modern algorithms such as:
bcrypt
Argon2
scrypt
Hashing transforms passwords into irreversible values. Even if your database is compromised, attackers cannot immediately recover users' original passwords.
A secure authentication system assumes that breaches can happen and minimizes the damage if they do.
Protect Against Brute Force Attacks
Attackers often attempt thousands of password combinations to gain unauthorized access.
To reduce this risk, implement:
Login rate limiting
Temporary account lockouts
CAPTCHA after multiple failed attempts
IP throttling
Progressive delays between login attempts
These techniques make automated attacks significantly more difficult without negatively affecting legitimate users.
Enable Multi-Factor Authentication (MFA)
Passwords alone are no longer enough for high-value applications.
Multi-Factor Authentication adds an additional verification step before granting access.
Common MFA methods include:
Authentication apps
SMS verification
Email verification codes
Hardware security keys
Passkeys
Even if a password is compromised, MFA provides another layer of protection that dramatically improves account security.
Validate Everything on the Server
Frontend validation improves user experience, but it should never be trusted for security.
Every request must be validated again on the server.
Examples include:
Email format
Password length
User permissions
Token validity
Input sanitization
Client-side validation can easily be bypassed. Server-side validation cannot.
Implement Email Verification
Verifying user email addresses offers several benefits.
It helps:
Prevent fake account creation
Reduce spam registrations
Confirm account ownership
Improve password recovery reliability
Most authentication providers include email verification as a built-in feature, making it easy to add to your authentication flow.
Use Secure Password Policies
Strong password requirements reduce the likelihood of compromised accounts.
A reasonable password policy might include:
Minimum 8–12 characters
Uppercase letters
Lowercase letters
Numbers
Special characters
Avoid forcing unnecessarily complex passwords, as overly strict requirements often encourage users to reuse or write down passwords.
Long, memorable passphrases are generally more secure than short, complicated passwords.
Secure Session Management
Authentication doesn't end after login.
Your application should also manage sessions responsibly by:
Automatically expiring inactive sessions
Rotating refresh tokens
Invalidating sessions after logout
Limiting concurrent sessions when necessary
Good session management protects users even after authentication has already succeeded.
Common Authentication Mistakes to Avoid
Many authentication issues aren't caused by React—they stem from implementation mistakes.
Here are some of the most common problems developers encounter.
Storing Sensitive Data Insecurely
Avoid storing passwords, refresh tokens, or sensitive credentials anywhere accessible to client-side JavaScript.
Use secure, well-established authentication patterns instead of creating your own storage mechanisms.
Exposing Protected Routes
Hiding a navigation link doesn't secure a page.
Always verify authentication before rendering protected content.
Your backend should also verify every protected API request regardless of what the frontend displays.
Trusting Client-Side Roles
Never assume a user's role based solely on frontend data.
Even if React says a user is an administrator, your server should independently verify that permission before performing sensitive operations.
Authorization decisions should always happen on the backend.
Forgetting Token Expiration
Access tokens should expire after a reasonable amount of time.
Long-lived tokens increase security risks if they're ever compromised.
Refresh tokens exist to improve user experience without sacrificing security.
Ignoring Error Handling
Authentication isn't always successful.
Your application should gracefully handle scenarios such as:
Invalid credentials
Expired sessions
Network failures
Unauthorized requests
Server downtime
Helpful error messages improve both usability and debugging.
Authentication Architecture for Modern React Applications
A production-ready authentication architecture often looks like this:
Browser
↓
React Application
↓
Authentication Context
↓
Authentication Provider (Auth0, Firebase, Clerk, Supabase, Better Auth, or SuperTokens)
↓
Backend API
↓
Database
Each layer has a clearly defined responsibility, making the application easier to maintain, test, and scale.
Image Placement Suggestions
To improve readability and engagement, consider placing relevant visuals throughout this guide.
After "How React Authentication Works"
Insert a simple authentication flow diagram showing:
User → Login → Authentication Server → Token → React → Protected Routes → API
After "JWT Authentication Explained"
Add an illustration showing the structure of a JSON Web Token:
Header → Payload → Signature
After "React Context Authentication"
Include a diagram demonstrating how the Authentication Context shares state across multiple components.
After "Authentication Providers"
Add a comparison graphic displaying the logos of:
Auth0
Firebase
Clerk
Supabase
Better Auth
SuperTokens
This helps readers quickly recognize the most popular solutions.
After "Protected Routes"
Include a flowchart illustrating:
Unauthenticated User
↓
Login Page
↓
Successful Login
↓
Dashboard
↓
Protected Content
Near the Conclusion
Add a modern dashboard screenshot featuring:
Logged-in user profile
Sidebar navigation
Authentication status
Protected admin interface
Real-world visuals make technical articles feel more approachable.
Frequently Asked Questions
Which authentication method is best for React?
For most modern applications, JWT combined with secure HTTP-only cookies offers an excellent balance of scalability, security, and performance. If you prefer a managed solution, Auth0, Clerk, Firebase Authentication, and Supabase Authentication are all strong choices depending on your project's requirements.
Should I build authentication from scratch?
Only if your project has very specific requirements.
Building authentication correctly requires handling password hashing, token generation, session management, email verification, password resets, brute-force protection, and much more.
For most projects, using a trusted authentication provider saves significant development time while improving security.
Is React Context enough for authentication?
Yes.
For many applications, React Context provides everything needed to manage authentication state.
Larger enterprise applications may combine Context with additional state management solutions, but React Context remains an excellent starting point.
What is the difference between authentication and authorization?
Authentication verifies who a user is.
Authorization determines what that authenticated user is allowed to access.
Authentication always happens before authorization.
Can I use social login with React?
Absolutely.
Most authentication providers support popular identity providers including:
Google
GitHub
Microsoft
Apple
Facebook
LinkedIn
Social login often improves user experience by reducing registration friction.
What is the safest place to store authentication tokens?
For web applications, HTTP-only cookies are generally considered the most secure option because they cannot be accessed by client-side JavaScript, helping mitigate common attacks such as Cross-Site Scripting (XSS).
Do I need a backend for authentication?
It depends on the authentication solution.
Managed providers like Firebase Authentication or Clerk handle much of the authentication process for you, while custom JWT or session-based authentication requires a backend to verify credentials, generate tokens, and protect APIs.
Final Thoughts
Authentication is one of the most important building blocks of every modern React application. It not only protects sensitive information but also creates personalized experiences that users expect from today's web applications.
As your application grows, your authentication requirements will evolve as well. A simple email and password login may be enough for an MVP, while larger products often require features such as social login, multi-factor authentication, role-based permissions, secure API authorization, and enterprise single sign-on.
Fortunately, React's flexibility allows you to choose the authentication strategy that best fits your project. Whether you prefer building a custom solution with JWT and Express, integrating Firebase Authentication, leveraging Auth0's enterprise capabilities, adopting Clerk's polished developer experience, choosing Supabase for an open-source backend, or self-hosting with Better Auth or SuperTokens, the underlying principles remain the same: verify identity, protect resources, manage sessions securely, and provide a seamless user experience.
Before implementing authentication, take time to evaluate your application's long-term goals. Selecting the right architecture early will reduce technical debt, simplify maintenance, and improve scalability as your user base grows.
By combining secure authentication practices, thoughtful user experience, and modern React development patterns, you'll be well-equipped to build applications that users can trust today and continue to rely on in the future.
Key Takeaways
Authentication verifies user identity, while authorization controls access.
React relies on external authentication providers or custom backend implementations.
JWT and session-based authentication are the two most common approaches.
React Context is an effective way to manage authentication state.
Protected routes prevent unauthorized access to sensitive pages.
Secure APIs should validate every request using access tokens or sessions.
HTTP-only cookies provide stronger security for web applications than client-accessible storage.
Providers such as Auth0, Firebase, Clerk, Supabase, Better Auth, and SuperTokens simplify authentication while following industry best practices.
Always implement HTTPS, password hashing, email verification, rate limiting, and multi-factor authentication for production applications.
Choosing the right authentication architecture early makes your application more secure, maintainable, and scalable.
Thank you for reading this complete guide. You now have a strong foundation to confidently implement secure, scalable, and modern authentication in your next React application.