Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Password Reset Flows
📖 Scenario: You are helping a website improve its user experience by designing a clear and simple password reset flow. This flow helps users who forgot their password to regain access safely.
🎯 Goal: Build a step-by-step password reset flow that includes user input, verification, and password update steps.
📋 What You'll Learn
Create a list of steps involved in a password reset flow
Add a variable to track if the user has verified their identity
Use a loop or sequence to simulate moving through the reset steps
Complete the flow by confirming the password has been reset
💡 Why This Matters
🌍 Real World
Password reset flows are essential for user account security and usability on websites and apps.
💼 Career
Understanding password reset flows helps in roles like UX design, product management, and software development focused on user authentication.
Progress0 / 4 steps
1
Create the password reset steps list
Create a list called reset_steps with these exact steps in order: 'Enter email', 'Receive code', 'Verify code', 'Set new password', 'Confirm reset'.
No-Code
Hint
Use square brackets to create a list and include all steps as strings in the correct order.
2
Add verification status variable
Create a variable called is_verified and set it to False to track if the user has verified their identity.
No-Code
Hint
Use a simple assignment to create a boolean variable.
3
Simulate going through reset steps
Use a for loop with the variable step to go through each item in reset_steps. Inside the loop, add an if statement that sets is_verified = True when step is 'Verify code'.
No-Code
Hint
Use a for loop and an if condition to check the current step and update the verification status.
4
Complete the password reset flow
After the loop, create a variable called reset_complete and set it to True only if is_verified is True. This confirms the password reset process is finished.
No-Code
Hint
Use a simple comparison to set the final reset_complete variable.
Practice
(1/5)
1. What is the main purpose of a password reset flow in an application?
easy
A. To change the username of the user
B. To delete the user account permanently
C. To help users regain access to their accounts safely
D. To update the user's email address
Solution
Step 1: Understand the purpose of password reset
Password reset flows are designed to help users who forgot their password regain access to their accounts.
Step 2: Identify the correct purpose among options
Only To help users regain access to their accounts safely describes this purpose correctly, while others describe unrelated actions.
Final Answer:
To help users regain access to their accounts safely -> Option C
Quick Check:
Password reset purpose = regain access [OK]
Hint: Password reset helps regain access, not change username [OK]
Common Mistakes:
Confusing password reset with username change
Thinking password reset deletes account
Assuming password reset updates email
2. Which of the following is a common step in a password reset flow?
easy
A. Changing the user's username to 'reset_user'
B. Automatically changing the password without user input
C. Deleting the user account after reset request
D. Sending a reset link or code to the user's email
Solution
Step 1: Identify typical password reset steps
Commonly, a reset link or code is sent to the user's registered email to verify identity.
Step 2: Compare options to standard practice
Only Sending a reset link or code to the user's email matches this standard step; others describe incorrect or harmful actions.
Final Answer:
Sending a reset link or code to the user's email -> Option D
Quick Check:
Reset step = send link/code [OK]
Hint: Reset flows send links or codes, not auto-change passwords [OK]
Common Mistakes:
Thinking password resets happen without user confirmation
Believing accounts get deleted after reset
Confusing username change with password reset
3. In a password reset flow, why is it important that the reset link expires after some time?
medium
A. To prevent unauthorized use if the link is intercepted
B. To allow users to reset password multiple times quickly
C. To make the reset process slower and more secure
D. To automatically change the password after expiration
Solution
Step 1: Understand security risks of reset links
If a reset link never expires, someone who gets it later could misuse it to access the account.
Step 2: Identify why expiration helps security
Expiration limits the time window for misuse, protecting the user's account.
Final Answer:
To prevent unauthorized use if the link is intercepted -> Option A
Quick Check:
Expiration = prevent misuse [OK]
Hint: Expiration stops old links from being misused [OK]
Common Mistakes:
Thinking expiration slows down the process intentionally
5. You want to design a password reset flow that prevents attackers from guessing reset codes easily. Which approach is best?
hard
A. Use short numeric codes that expire quickly
B. Use long random alphanumeric codes with expiration
C. Send the reset code via public chat for transparency
D. Allow unlimited attempts to enter the reset code
Solution
Step 1: Consider code complexity and expiration
Long random alphanumeric codes are harder to guess than short numeric ones, and expiration limits time for attacks.
Step 2: Evaluate options for security
The approach of using long random alphanumeric codes with expiration combines strong code complexity with time-limited validity, providing optimal security. Other approaches--short numeric codes, unlimited entry attempts, and public code sharing--are vulnerable to guessing, brute-force attacks, or interception.
Final Answer:
Use long random alphanumeric codes with expiration -> Option B
Quick Check:
Strong code + expiration = best security [OK]
Hint: Long random codes with expiration improve security best [OK]