Password Reset & Email Verification
Round out email/password auth by letting users reset forgotten passwords and verify their email addresses, improving both security and account recoverability.
Password Reset & Email Verification is a free Firebase Auth & Realtime Database Apps lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Firebase Auth & Realtime Database Apps learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Reset and Verification Matter
Email/password sign-in is incomplete without two flows: password reset for forgotten credentials and email verification to prove the user owns the address.
- Reset reduces support tickets and lockouts
- Verification blocks fake or mistyped emails
How Password Reset Works
The flow is entirely email-driven so the user never reveals an old password:
- User requests a reset for their email
- Firebase sends a secure, time-limited link
- User clicks it and chooses a new password
Your app only triggers the email; Firebase hosts the reset page by default.
Triggering a Reset Email
Call sendPasswordResetEmail with the user's address. Firebase handles delivery and the link.
import { getAuth, sendPasswordResetEmail } from 'firebase/auth';
const auth = getAuth();
await sendPasswordResetEmail(auth, 'user@example.com');
console.log('Reset email sent');Handling Reset Errors Gracefully
For security, avoid revealing whether an email exists. Show the same confirmation message whether or not the account is found.
try {
await sendPasswordResetEmail(auth, email);
} catch (e) {
// log internally but do not expose to user
}
showMessage('If that email exists, a reset link was sent.');Sending a Verification Email
After a user signs up, send a verification email with sendEmailVerification on the current user object.
import { getAuth, sendEmailVerification } from 'firebase/auth';
const user = getAuth().currentUser;
if (user) {
await sendEmailVerification(user);
}Checking Verification Status
The user object exposes emailVerified. Use it to gate sensitive features until the address is confirmed.
const user = getAuth().currentUser;
if (user && !user.emailVerified) {
showBanner('Please verify your email to continue.');
}Refreshing the Token After Verification
The emailVerified flag is cached in the ID token. After a user verifies, call reload to refresh their local state.
const user = getAuth().currentUser;
await user.reload();
console.log('Verified now?', user.emailVerified);Customizing Email Templates
In the Firebase console under Authentication > Templates you can customize the sender name, subject, and body of reset and verification emails, and set a custom action URL for branded pages.
Enforcing Verification
You can require a verified email before granting access to certain data using Security Rules. Tokens carry an email_verified claim you can check.
{
"rules": {
"posts": {
".write": "auth != null && auth.token.email_verified == true"
}
}
}Rate Limiting and Abuse
Firebase throttles repeated reset and verification requests to prevent abuse and spam. In your UI, disable the button briefly after sending so users do not trigger the limit accidentally.
Putting It Together
A complete signup typically looks like: create account, send verification email, show a 'check your inbox' screen, and reveal full features once emailVerified becomes true. A 'Forgot password?' link calls the reset flow.
Quick Check
Test your understanding of reset and verification.
Recap
Your email/password auth is now complete and recoverable.
- Use
sendPasswordResetEmailfor forgotten passwords - Avoid revealing whether an email exists
- Verify ownership with
sendEmailVerificationandemailVerified - Call
reloadto refresh status - Customize templates and enforce verification via rules
Frequently asked questions
Is the “Password Reset & Email Verification” lesson free?
Yes — the full text of “Password Reset & Email Verification” is free to read here on the web, and the Firebase Auth & Realtime Database Apps course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Firebase Auth & Realtime Database Apps course, upgrade to CoddyKit PRO.
What will I learn in “Password Reset & Email Verification”?
Round out email/password auth by letting users reset forgotten passwords and verify their email addresses, improving both security and account recoverability. You practise Firebase Auth & Realtime Database Apps with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Firebase Auth & Realtime Database Apps?
No prior experience is required. Firebase Auth & Realtime Database Apps on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Password Reset & Email Verification” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Firebase Auth & Realtime Database Apps lesson?
Yes. Every Firebase Auth & Realtime Database Apps lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Email/Password Authentication Implementation
- Managing User Sessions & States
- Handling Authentication Errors
- Password Reset & Email Verification