π Add Email Verification
To ensure users provide a valid email, you'll add a verification step.
β In the AI Studio "Code assistant" prompt box, enter the following instructions:
Implement email verification.
Create an email verification screen: "We have sent you a verification email to β¦. Verify it and log in" + Login Button. If a user registers with email/password. Do not sign them in automatically. Verify their email using Firebase authentication and display the verification screen.
If a user logs in and their email is not verified, do the same as after registration. Do not implement Firestore, only use Firebase Authentication.
β Send the prompt to the AI assistant.
β Test the Flow:
- Log out of your app.
- Try to log in with the test user you created earlier or create a new account with another email
- You will now be shown the "Verify your email" screen instead of being logged in.
- Check your email inbox for the verification email (it will be in Spam if your domain isnβt verified).
- Click the verification link in the email. A new tab will open confirming "Your email has been verified."
- Go back to your app, click "Back to Login", and sign in with the same credentials.
And that's it! You will now be logged in successfully.