🚀 Add Password Change
Next, you'll add a "Forgot Password" flow so users can reset their passwords.
→ In the AI Studio "Code assistant" prompt box, enter the following instructions:
Add a 'Forgot password?' prompt. When it's clicked let the user enter their email or pass it on from the sign in form. When user clicks 'Get Reset Link', trigger the password change using Firebase Authentication. Display 'We sent you a password change link to ...' and 'Sign In' button.
→ Send the prompt to the AI assistant.
→ Test the Flow:
- On your app's sign-in page, click the new "Forgot password?" link.
- You'll be taken to a "Reset Password" screen.
- Enter the email address of a registered user and click "Get Reset Link".
- A "Check your inbox" message will appear.
- Go to your email inbox (check Spam). You will find a "Reset your password" email.
- Click the link in the email. A Firebase page will open.
- Enter your new password and click "Save".
- Go back to your app and log in with your email and your new password.
It should now log you in successfully.