What Actually Happens When You Log Into a Website?
You enter:
Email + Password
Then you click Login.
But what happens behind the scenes?
Frontend
Your React application sends your login details to the backend API.
API
The backend receives the request and looks for the user in the database.
Database
The user's account is found and the stored password hash is checked against the password you provided.
Authentication
If the credentials are correct, the backend creates an access token (and often a refresh token).
Response
The backend sends the authentication result back to the frontend.
Future requests
When you request protected data, your application sends the access token so the backend knows who you are.
The whole process:
Login Form → API → Database → Verify → Token → Frontend → Protected Requests
That's what is happening behind that simple “Login” button.
Image failed to load.