Module 44: Authentication

Lesson 5 of 5 · 15–25 minutes

Sign-in flows and common attacks

🏠The everyday picture

A building's security isn't just a good lock: it's a guard who notices someone trying every key, a visitor log, and a safe process for replacing lost keys.

📘What it really is

A secure sign-in flow:

🖱️Try it

Update your sign-in to use the same message for both failures, add a simple counter that blocks an email for 15 minutes after 5 failed attempts, and log each failure (with email and time, never the password). Connect the React app's login page from Module 36 to the real API, sending credentials: "include", and protect the dashboard using /me.

✅Quick check

Why say "Email or password is incorrect" instead of "No account with that email"?

Show the answer

So attackers can't discover which emails have accounts.

What's credential stuffing, and what helps against it?

Show the answer

Trying usernames and passwords leaked from other sites; rate limiting, MFA and checking for leaked passwords help.

← PreviousTokens and JWT
ProLearners Assist