Recall & Review
beginner
What is the main purpose of a user registration flow in an Express app?
To allow new users to create an account by providing their details, which the server then validates and stores securely.
Click to reveal answer
beginner
Which HTTP method is commonly used to submit user registration data?
POST method is used because it sends data in the request body to create a new user.
Click to reveal answer
intermediate
Why should passwords be hashed before storing in the database during registration?
Hashing protects user passwords by converting them into a secure format that cannot be easily reversed, keeping user data safe even if the database is compromised.
Click to reveal answer
beginner
What middleware in Express helps parse incoming JSON data from a registration form?
express.json() middleware parses JSON data from the request body so the server can access user input easily.
Click to reveal answer
intermediate
How can you handle validation errors in a user registration flow?
By checking user input for required fields and correct formats, then sending clear error messages back to the client to fix before resubmitting.
Click to reveal answer
Which Express method handles POST requests for user registration?
✗ Incorrect
app.post() is used to handle POST requests, which are typical for submitting registration data.
What is the role of express.json() in a registration route?
✗ Incorrect
express.json() middleware parses incoming JSON data so the server can read user input.
Why should passwords never be stored as plain text?
✗ Incorrect
Storing passwords hashed protects users if the database is compromised.
Which status code is appropriate to send when registration data is invalid?
✗ Incorrect
400 Bad Request indicates the client sent invalid data.
What is a common step after successful user registration?
✗ Incorrect
Redirecting to login lets the user sign in after creating an account.
Describe the key steps in building a user registration flow with Express.
Think about what happens from receiving data to storing it safely.
You got /6 concepts.
Explain why input validation and password hashing are important in user registration.
Consider risks of bad data and password leaks.
You got /3 concepts.